Uploaded image for project: 'Flagon'
  1. Flagon
  2. FLAGON-120

Python logging module interferes with other applications logging

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • UserALE.PyQt5 0.1.0
    • UserALE.PyQt5 0.1.0
    • UserALE.PyQt5
    • None
    • Patch
    • Sprint 4

    Description

      We found a bug in UserALE logging that seems to be a very simple fix. In fact, I have attached a modified version of ale.py which I believe addresses the issue.

      The issue arises when UserALE is used to instrument a program which also utilizes the python logging module. Since UserALE leverages the logging.baseConfig() functionality, it shares the root logger in that module with any other part of the program which performs logging. Therefore any modifications to the root logger affect output everywhere it is utilized. This cropped up in ImageMagickGUI. The real issue is with logging.baseConfig(): if any handlers are set up for the root logger prior to a call to baseConfig(), the subsequent call is ignored. To prevent this overlap, I created a new logger object in ale.py and gave it all the attributes of the original logger. I additionally set it to ignore the logger hierarchy in the logging module, so that the UserALE output doesn’t propagate to other loggers. Preliminary testing suggests that this has rectified the issue without removing functionality or introducing features.

      Attachments

        Activity

          People

            msbeard Michelle Beard
            msbeard Michelle Beard
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 1h
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified