Skip to content Skip to sidebar Skip to footer

Python Can You Accidentally Overwrite A Logger By Using Getlogger With The Same Name?

In my Python program, I import a module (let's say it's called bananas). The module gets a logger inside its __init__.py by doing this: _logger = logging.getLogger(__name__). Thus

Solution 1:

It fetches the bananas logger, so that my_logger is the same object as bananas._logger.


Post a Comment for "Python Can You Accidentally Overwrite A Logger By Using Getlogger With The Same Name?"