We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
It seems this is the simplest for color output:
import colorlog, logging q = logging.StreamHandler() q.setFormatter(colorlog.ColoredFormatter( "%(log_color)s%(levelname)s%(reset)s %(message)s", log_colors = {'INFO': 'green', 'WARNING': 'yellow', 'ERROR': 'red'} )) z = logging.getLogger() z.addHandler(q) z.warning('abcde')
https://github.com/borntyping/python-colorlog/blob/master/doc/example.py
other projects have simpler syntax:
from logzero import logger logger.warning('abcde')
The text was updated successfully, but these errors were encountered:
Using logging or colorlog, you can do the following:
logging
colorlog
import colorlog colorlog.basicConfig() colorlog.warning("abcde")
import logging logging.basicConfig() logging.warning("abcde")
Like you can with logging, importing the library and calling logging methods should have the same effect:
import colorlog colorlog.warning("abcde")
(See colorlog/logging.py)
colorlog/logging.py
Sorry, something went wrong.
@borntyping that is perfect! thanks
No branches or pull requests
It seems this is the simplest for color output:
https://github.com/borntyping/python-colorlog/blob/master/doc/example.py
other projects have simpler syntax:
The text was updated successfully, but these errors were encountered: