When I reading Python’s logging documentation, I met this statement:
By default, no destination is set for any logging messages. You can
specify a destination (such as console or file) by using basicConfig()
as in the tutorial examples. If you call the functions debug(),
info(), warning(), error() and critical(), they will check to see if
no destination is set; and if one is not set, they will set a
destination of the console (sys.stderr) and a default format for the
displayed message before delegating to the root logger to do the
actual message output.
This is a confusion to me, since here debug(), info() … etc. methods is referring to the logging module’s debug method, and they are just a syntactic sugar for calling logger.debug() on root logger according to the documentation of logging.debug(). Since above quoted states “before delegating to the root logger”, I wonder here the debug() method is already called on the root logger, how can it delegating to the “root logger” any more ?