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
As stated in my title question, how should I change logging levels of other handles, like logging.FileHandler below.
logging.FileHandler
logging_format = '%(asctime)s %(hostname)s %(username)s %(programname)s %(name)s[%(process)d] %(levelname)s %(message)s' logging_level = "DEBUG" logging_file = "test.log" verboselogs.install() coloredlogs.install(level=logging_level, stream=sys.stdout, fmt=logging_format, milliseconds=True) # main logger logger = logging.getLogger("main") # add file handler logging_file_handler = logging.FileHandler(logging_file) logging_file_handler.setFormatter(coloredlogs.ColoredFormatter('%(asctime)s %(name)s[%(process)d] %(levelname)s %(message)s')) logging_file_handler.setLevel("SPAM") logger.addHandler(logging_file_handler) logger.debug("show in console") logger.spam("show in logging file only?")
In the above code, logging_file_handler.setLevel("SPAM") doesn't seem to work, the logging is same between console and file.
logging_file_handler.setLevel("SPAM")
The text was updated successfully, but these errors were encountered:
No branches or pull requests
As stated in my title question, how should I change logging levels of other handles, like
logging.FileHandler
below.In the above code,
logging_file_handler.setLevel("SPAM")
doesn't seem to work, the logging is same between console and file.The text was updated successfully, but these errors were encountered: