I have two scripts
- first.py
- second.py
in first.py, I am creating a logger as
log = logging.getLogger()
in second.py I am doing same thing as
log = logging.getLogger()
they are working fine individually. Problem is when I call first.py into second.py. Which lead to create two instance of logger. How to avoid this thing?
I want to use multiple such file to call in each other.
Multiple calls to getLogger() with the same name will always return a reference to the same Logger object.So how do you know that multiple loggers are being created?