Logging - gelisa/txdbus GitHub Wiki

Back to home page


From wolfhechel email: As for the logging, two approaches came to mind:

  1. Initialize logging alongside the event loop abstraction and pass the log object to all involved classes.
  2. Setup a global logging object in txdbus.log and upon initalization setup the appropriate logging facility (default to stdlib logging).
~~I would prefer alternative number 1 since IMHO global objects with common names (such as logger, log, logging) tend to collide with a lot of other packages and increase chances of circular import dependencies.~~

Actually I just remembered twisted can interact with the stdlib logging library as well through `twisted.python.log.PythonLoggingObserver`.

So I would change it to using `logging` and in the twisted interface implementation use that.

    1. Implementation plan
  1. Use stdlib logging library.
  2. In the twisted interface implementation use `twisted.python.log.PythonLoggingObserver`
⚠️ **GitHub.com Fallback** ⚠️