You haven't configured the logging system, so it's still using the defaults (level WARN for the root logger).
https://docs.python.org/3/library/logging.html#logging.basicConfig says basicConfig
Does basic configuration for the logging system by creating a
StreamHandler with a default Formatter and adding it to the root
logger.
Configuring the logging system with basicConfig first will create a handler and formatter that your logger will use:
logging.basicConfig()
log = logging.getLogger('hello')
log.setLevel(logging.DEBUG)
print(log.getEffectiveLevel())
log.debug('debug log')
log.critical('critical log')
Outputs:
10
DEBUG:hello:debug log
CRITICAL:hello:critical log
In Logger.callHandlers, each handler compares the log record's level with its level. If there aren't any handlers, it will use the default of WARNING.
stdoutorstderr?.setLevel()?