python-colorlog | A colored formatter for the python logging module
kandi X-RAY | python-colorlog Summary
kandi X-RAY | python-colorlog Summary
Add colours to the output of Python’s logging module.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Setup a logger
- Decorator to configure logging
- Configures logging
- Load configuration
- Return escape codes
python-colorlog Key Features
python-colorlog Examples and Code Snippets
Community Discussions
Trending Discussions on python-colorlog
QUESTION
I wish to log to file as well as show the same information in the terminal window, but with nice colors (using colorlog or other cross-platform log colorizer). This is what I have:
...ANSWER
Answered 2017-Jan-23 at 19:45There are two issues in your (original) code. The first was a minor error in which you assigned color_formatter
to the log handler instead of the terminal handler.
The second issue - that you weren't seeing logs below WARNING
level in your terminal - was caused by the fact that you were setting the minimum logging level on the terminal handler but not the logger itself. You need to replace:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install python-colorlog
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page