Debug through logger's debug function
See original GitHub issuePardon me if this has already been answered. I know “debug” is not a logger and I respect that. I do not want to log with debug, I’d like debug to output in my logs instead. 😃 Specifically I’d like all third party modules using the ubiquitous “debug” to log through Winston’s debug function. It’s a matter of consistency turning log levels on/off dynamically. Is it possible?
I’ve tried to leverage node’s module caching in this way:
var Debug = require('debug');
var Logger = require('winston');
Debug.log = Logger.debug;
var mod = require('module_using_debug');
It’s not working… 😦
Issue Analytics
- State:
- Created 8 years ago
- Reactions:2
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Difference between logger.info and logger.debug
INFO is used to log the information your program is working as expected. · DEBUG is used to find the reason in case...
Read more >How To Use Logging in Python 3 | DigitalOcean
Debugging is an important step of any software development project. The logging module is part of the standard Python library, provides tracking ...
Read more >logger.debug function - RDocumentation
After initializing the level-specific log files with logger.setup(...) , this function will generate DEBUG level log statements.
Read more >How to add a DEBUG mode for your Python Logging Mid-Run
To initiate “debug_mode” we will have a function in module_1.py which initiates debug level in the root logger. Step 1: File creations. Create...
Read more >logging — Logging facility for Python — Python 3.11.1 ...
Logs a message with level DEBUG on this logger. ... This can be used in logging helpers so that the function name, filename...
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 FreeTop 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
Top GitHub Comments
After using it for a while, I’d say it’s not a perfect solution. It has at least 2 problems:
Did this happen? Having trouble finding it anywhere in the docs for 3.1