I have the following application structure:
./utils.py def do_something(logger=None): if not logger: logger = logging.getLogger(__name__) print(
If you don't like the existing solutions, here's a magic way to do it:
def do_something(): logger = inspect.currentframe().f_back.f_globals['log'] ...
The calling function must then have a global variable called log.
log