oslo.test changes default log level to info

Bug #1320841 reported by Marc Koderer
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
oslo-incubator
Fix Released
Undecided
Marc Koderer

Bug Description

Problem:
-----------
If OS_DEBUG is not set the root logger will be set to level INFO.
But the default value of the root logger is usually WARN.
See http://hg.python.org/cpython/file/2.7/Lib/logging/__init__.py#l1490

This can cause problems with mocking "time.time" see:
https://bugs.launchpad.net/tempest/+bug/1320482

Marc Koderer (m-koderer)
Changed in oslo:
assignee: nobody → Marc Koderer (m-koderer)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to oslo.test (master)

Fix proposed to branch: master
Review: https://review.openstack.org/94176

Changed in oslo:
status: New → In Progress
Revision history for this message
Ben Nemec (bnemec) wrote :

Even with the fix proposed, don't we still have the mocking problem if someone sets OS_DEBUG? It would be bad if tests passed in non-debug and then failed when debug is enabled. :-/

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to oslo.test (master)

Reviewed: https://review.openstack.org/94176
Committed: https://git.openstack.org/cgit/openstack/oslo.test/commit/?id=47f869c3f51bfbacf11596ee86212a5e13d3c2ce
Submitter: Jenkins
Branch: master

commit 47f869c3f51bfbacf11596ee86212a5e13d3c2ce
Author: Marc Koderer <email address hidden>
Date: Mon May 19 13:55:56 2014 +0200

    Set log level to default value

    Instead of setting the log level hard coded to INFO just let the used
    logger module decide which level is the default. Otherwise a usage
    of this module will change the log level globally to INFO which is not
    the default for the python logger module (see
    http://hg.python.org/cpython/file/2.7/Lib/logging/__init__.py#l1490)

    Change-Id: I75a0517564e6829dfc1451c77da888548ad2219c
    Closes-bug: 1320841

Changed in oslo:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to oslotest (master)

Fix proposed to branch: master
Review: https://review.openstack.org/95411

Thierry Carrez (ttx)
Changed in oslo:
milestone: none → juno-1
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to oslotest (master)

Reviewed: https://review.openstack.org/95411
Committed: https://git.openstack.org/cgit/openstack/oslotest/commit/?id=289d1dab8d3afa88451571ba8fe35e9b3f1aff51
Submitter: Jenkins
Branch: master

commit 289d1dab8d3afa88451571ba8fe35e9b3f1aff51
Author: Marc Koderer <email address hidden>
Date: Mon May 26 08:09:37 2014 +0200

    Add known issue about time.time mocking

    Since the log level may change by setting the environment variable
    OS_DEBUG a hint is added into the base class.

    Change-Id: I351e2c59fe75c14dba398cb734a9648650c26074
    Closes-bug: 1320841

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.