Collect console.debug, info and warn too
See original GitHub issueRight now only console.error is being enhanced to report errors to Datadog. I would like too:
- Be able to redirect console.debug, console.info and console.warn to Datadog (depending on the log level of course).
- Be able to hide console messages in my production environment.
Reasons:
Right now I log to datadog when I am in my production environment. In my localhost environment, I want to log into the console.
If I use “datadogLogs.logger.debug”, in my localhost environnement I have on those ugly warnings: logs.logger.debug' not yet available, please call '.init()' first.
I could wrap all my log conditionally like this of course:
if (process.env.REACT_APP_DATADOG_CLIENT_TOKEN) {
datadogLogs.logger.debug('...')
} else {
console.debug('...')
}
But that’s way too much code for one log.
Suggestion Improve startConsoleTracking to handle all logging methods from the console. Also, do not apply originalConsoleError all the time: use a configurable parameter to skip this part conditionnaly.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:9
- Comments:8 (2 by maintainers)
Top Results From Across the Web
When to use the different log levels - Stack Overflow
For me, you should start with DEBUG , INFO , WARNING and ERROR . Developers should see all levels. SysAdmins up to INFO...
Read more >console.debug() - Web APIs - MDN Web Docs
The console.debug() method outputs a message to the web console at the "debug" log level. The message is only displayed to the user...
Read more >Spark - Stop INFO & DEBUG message logging to console?
Now, Let's see how to stop/disable/turn off logging DEBUG and INFO messages to the console or to a log file. Using sparkContext.setLogLevel() ...
Read more >Logging HOWTO — Python 3.11.1 documentation
DEBUG ) logging.debug('This message should go to the log file') logging.info('So should this') logging.warning('And this, too') logging.error('And non-ASCII ...
Read more >Log messages in the Console tool - Microsoft Edge ...
Before DevTools, for JavaScript, you were limited to an alert() or document.write() statement to debug in the browser. With DevTools, to log ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hello @fromi,
Thanks for the feedback! It is something that we plan to do in the coming weeks.
We will ping here when it will be available.
This feature has been released in the Logs Browser SDK v4.8.0! See
forwardConsoleLogs
initialization parameter in the documentation