import logging logger = logging.getLogger(__name__) logger.setLevel(logging.DEBUG) print(logger.level) # 10 print(logging.getLevelName(logger.level)) # DEBUG