Well, the solution was to make some attempts to clear the Python logging module. I just wrapped the decorator around the logging.root.addHandler function, which printed the stack and voila, I found my culprit who called logging.getLogger (). If you call getLogger without any parameters, you get the root log.
import logging import sys import traceback def tracer(func): def new_func(*args, **kwargs): try: traceback.print_stack(sys.stderr) except: traceback.print_exc(sys.stderr) return func(*args, **kwargs) return new_func old_addHandler = logging.root.addHandler logging.root.addHandler = tracer(old_addHandler)
source share