-
Notifications
You must be signed in to change notification settings - Fork 39
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
Improve debug logs #342
Improve debug logs #342
Conversation
✅ Deploy Preview for cheery-moxie-4f1121 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's also useful to have a way to disable certain topics. If I'm debugging network, I usually don't want logs for wallet for example. You can do this by putting the setting in a config file, (see chainparams.json). You can also add log error levels (Debug, warn, error) and a way to filter (use the console functions so we can also filter them using the dev tools).
ready for review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tACK 1365249
Abstract
debug logging imo is very important, but at the moment is quite unused since we have to wrap each console.log inside a
if(debug){...}
This PR solves the issue by adding some util functions like
debugLog
;DebugTopics are also added, so we can easily understand which part of the application printed the message
finally DebugTopics can be activated and deactivated: this can be done from the file
debug_config.json
Testing
Activate debug and see that it works as expected