August 2018
Intermediate to advanced
366 pages
10h 14m
English
logging.basicConfig configures the root logger (the main logger, Python will use if no specific configuration for the used logger is found) to write anything at the INFO level or greater. This will allow us to show everything apart from the debugging messages. The format argument specifies how our logging messages should be formatted; in this case, we added the date and time, the name of the logger, the level at which we are logging, and the message itself. Finally, the stream argument tells the logger to write its output to the standard error.
Once we have the root logger configured, any logging we pick that doesn't have a specific configuration will just end up using the root logger one.
So the next line, logging.getLogger(__name__) ...