0

I have a Python library that has an internal Logger, something like this:

library_logger = logging.getLogger("library.submodule")

I have a lightweight wrapper class of the library that has it's own Logger:

wrapper_logger = logging.getLogger("my_package.library_wrapper")

I would like to one-way link the wrapper's logger to the library's logger such that:

  • LogRecords from the library go through the wrapper's Handlers (e.g. FileHandler), but not vice versa
  • Any changes to the wrapper's log level get propagated to the library's log level, but not vice versa

How can this be done?


Other Answers

Intrastellar Explorer
  • 3,005
  • 9
  • 52
  • 119

0 Answers0