Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-8605

problems setting log level in Python unit tests

    Details

    • Type: Bug
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: utils
    • Labels:
      None

      Description

      Example: meas_algorithms/tests/testMeasure.py
      In the past, I could simply change this line to
      Log.getLogger("measurement").setLevel(Log.DEBUG)
      and then running the test would show the DEBUG log messages. But that no longer works since DM-7955.

      I think this is because:

      DM-7150 added a hard-coded log configuration, using lsst.log.configure_prop(), to the initialization code of Python unit tests (init() in utils/tests.py ). It was done because the default log configuration at that time was disliked.

      Later, DM-7955 improved the default config as well as the configuration process in log, and lsst.log.configure_prop() now would reset configuration (including resetting all loggers). Customizing the log level of a specific logger on the top of the test file no longer does what users want, because init() resets it (if I understand correctly)

      So, I'm thinking to remove the log re-configuring in utils; in other words. revert DM-7150.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                hchiang2 Hsin-Fang Chiang
                Reporter:
                hchiang2 Hsin-Fang Chiang
                Reviewers:
                Andy Salnikov
                Watchers:
                Andy Salnikov, Hsin-Fang Chiang, Perry Gee, Tim Jenness
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Summary Panel