If logging.info() is enough for logging, why we have to instantiate a logger with getLogger() method?
If logging.info() is enough for logging, why we have to instantiate a logger with
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Calling
getLogger()without a name returns the root logger:Calling the module-level
info()function logs directly to the root logger:If you have no use for specifically named loggers (for example in order to identify the emitting module of the log), the two calls are exactly equivalent.