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

Configure a default log for tests

    XMLWordPrintable

    Details

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

      Description

      The default configurations such as format and levels are different between lsst.pex.logging and lsst.log. With DM-6999 logs of command line tasks are changed from lsst.pex.logging to lsst.log. For running command line tasks, logs are configured in pipe_base.

      Based on RFC-203, another main use case is debug logging by running unit tests. In this case, log are not (and cannot be) configured in pipe_base command line interface. This ticket adds a default configuration in lsst.utils.tests so the default logs will look more similar to what they have been with pex.logging when running unit tests. Developers can put customized configuration in each unit test (after DM-6999).

        Attachments

          Issue Links

            Activity

            Hide
            hchiang2 Hsin-Fang Chiang added a comment - - edited

            An example log record from running unit tests directly. This is testPsfDetermination with log records from SingleFrameMeasurementTask (with its _DefaultName = "measurement")

            master (from the default pex.logging LogFormatter):

            measurement: Measuring 13 sources (13 parents, 0 children) 
            

            Switching to use lsst.log:

            1055 [0x7fff732fb000] INFO measurement null - Measuring 13 sources (13 parents, 0 children) 
            

            With this ticket branch:

            INFO  measurement: Measuring 13 sources (13 parents, 0 children) 
            

            Jenkins for this ticket:
            https://ci.lsst.codes/job/stack-os-matrix/compiler=gcc,label=centos-7,python=py2/13968//console

            Jenkins with DM-6999:
            https://ci.lsst.codes/job/stack-os-matrix/compiler=gcc,label=centos-7,python=py2/13964//console

            Show
            hchiang2 Hsin-Fang Chiang added a comment - - edited An example log record from running unit tests directly. This is testPsfDetermination with log records from SingleFrameMeasurementTask (with its _DefaultName = "measurement") master (from the default pex.logging LogFormatter): measurement: Measuring 13 sources (13 parents, 0 children) Switching to use lsst.log: 1055 [0x7fff732fb000] INFO measurement null - Measuring 13 sources (13 parents, 0 children) With this ticket branch: INFO measurement: Measuring 13 sources (13 parents, 0 children) Jenkins for this ticket: https://ci.lsst.codes/job/stack-os-matrix/compiler=gcc,label=centos-7,python=py2/13968//console Jenkins with DM-6999 : https://ci.lsst.codes/job/stack-os-matrix/compiler=gcc,label=centos-7,python=py2/13964//console
            Hide
            hchiang2 Hsin-Fang Chiang added a comment -

            Tim Jenness may you please review this?

            Show
            hchiang2 Hsin-Fang Chiang added a comment - Tim Jenness may you please review this?
            Hide
            tjenness Tim Jenness added a comment -

            Minor comments on the PR. Please also add a couple of sentences to the testing section of the developer guide to indicate that init() should be called to initialize the logger if you are using it during tests (otherwise people may not realise they need to use it if they aren't testing for leaks).

            Show
            tjenness Tim Jenness added a comment - Minor comments on the PR. Please also add a couple of sentences to the testing section of the developer guide to indicate that init() should be called to initialize the logger if you are using it during tests (otherwise people may not realise they need to use it if they aren't testing for leaks).
            Hide
            hchiang2 Hsin-Fang Chiang added a comment -

            Thank you Tim Jenness for your review.

            Corrections are made and a small section is added to the developer guide Python Unit Testing.

            Running Jenkins before merging.

            Show
            hchiang2 Hsin-Fang Chiang added a comment - Thank you Tim Jenness for your review. Corrections are made and a small section is added to the developer guide Python Unit Testing. Running Jenkins before merging.
            Hide
            hchiang2 Hsin-Fang Chiang added a comment -

            Both utils and dm_dev_guide are merged.

            Show
            hchiang2 Hsin-Fang Chiang added a comment - Both utils and dm_dev_guide are merged.

              People

              Assignee:
              hchiang2 Hsin-Fang Chiang
              Reporter:
              hchiang2 Hsin-Fang Chiang
              Reviewers:
              Tim Jenness
              Watchers:
              Hsin-Fang Chiang, Tim Jenness
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Jenkins

                  No builds found.