Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do you log to the console? #324

Open
NatyveCoder opened this issue Apr 27, 2021 · 1 comment
Open

How do you log to the console? #324

NatyveCoder opened this issue Apr 27, 2021 · 1 comment

Comments

@NatyveCoder
Copy link

Is your feature request related to a problem? Please describe.
I have no idea how to debug my application

Describe the solution you'd like
I expected console.log() to log to the terminal, but there is no output in the terminal

Describe alternatives you've considered
I'm not sure what alternatives there are.

Additional context
I'm trying to do a simple input-output app as a hello-world example. Type in text in a textbox up top, and the hashed output is output to the Text component. There is no output in my text component, and I have no way of debugging to see if my hash function is being called when the TextInput value is being changed.

@jcolag
Copy link

jcolag commented Jun 11, 2021

For what it's worth (a month and a half later), I haven't had a problem getting text to the console. Or, rather, as long as I put console.log() somewhere sensible that doesn't break the build--because I have a tendency to clumsily drop it in the middle of a render--it worked.

If you don't mind my asking, how are you triggering state changes? In my note-taking program, my multi-line TextInput includes onChangeText={text => this.noteUpdated(text)}, where noteUpdated() handles state-tracking and other things. A lot of logging statements have gone in there, though I don't think there are any left just now.

I've also had decent success with Winston for a more complicated project, where I wanted to keep the output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants