Uploaded image for project: 'RHEL Conversions'
  1. RHEL Conversions
  2. RHELC-724

Move NullHandler logging config to an early-startup initialization function

XMLWordPrintable

    • 1
    • True
    • False
    • 2023-Q1

      When we started using DBus, we noticed that the DBus library set a root logging handler in its library code (contrary to Python best practices). This caused the messages that we sent to our logger to be logged twice, once by our handler and once by the DBus one. We worked around this by adding a NullHandler logging handler to the logging.py file. This handler is initialized when logger.py is imported.

      While this works, it is a little fragile. This code must be run before dbus is imported which is currently the case with logger.py but it's not guaranteed. To remedy this, we should move it to a dedicated early-startup intialization phase. rolivier@redhat.com  is introducing an early-startup phase in his merge yum transactions PR that we could use here.

      Implementation

            tkuratom@redhat.com Toshio Kuratomi
            tkuratom@redhat.com Toshio Kuratomi
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: