Answer the question
In order to leave comments, you need to log in
How does a logger work in Python?
Suppose I have two modules app.py and foo.py
I understand correctly that it is enough for me to configure the logger in the app.py module like this:
logging.basicConfig(level=logging.INFO)
log = logging.getLogger()
handler = logging.handlers.SysLogHandler(address='/dev/log') # or logging.StreamHandler()
log.addHandler(handler)
log = logging.getLogger()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question