How to get the current log level in python logging module
If you're using the root logger, for example because you called logging.basicConfig()
then you can use
import logging
logging.root.level
For example
if logging.DEBUG >= logging.root.level:
# Do something
Yes, you can check the logger level by
level = logger.level