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
Python 3.11.8, my code is
from loguru import logger logger.level('INFO') if __name__ == '__main__': logger.debug('debug') logger.info('info') logger.success('success') logger.warning('warning') logger.error('error') logger.critical('critical') logger.exception('exception')
the print is
2024-08-13 10:23:43.683 | DEBUG | __main__:<module>:6 - debug 2024-08-13 10:23:43.683 | INFO | __main__:<module>:7 - info 2024-08-13 10:23:43.683 | SUCCESS | __main__:<module>:8 - success 2024-08-13 10:23:43.683 | WARNING | __main__:<module>:9 - warning 2024-08-13 10:23:43.683 | ERROR | __main__:<module>:10 - error 2024-08-13 10:23:43.683 | CRITICAL | __main__:<module>:11 - critical 2024-08-13 10:23:43.683 | ERROR | __main__:<module>:12 - exception NoneType: None
Why does DEBUG and INFO display?
The text was updated successfully, but these errors were encountered:
You need to replace the default sink.
sink
logger.remove() logger.add(sink=sys.stdout, level="DEBUG")
Sorry, something went wrong.
The level() method is only used to retrieve, modify or add a log level usable by the logger.log().
level()
logger.log()
As indicated by @destin-v, if you want to change the default handler, simply replace it by a new one with the threshold level you desire.
No branches or pull requests
Python 3.11.8, my code is
the print is
Why does DEBUG and INFO display?
The text was updated successfully, but these errors were encountered: