debug_logger: ensure NOTICE level is registered
The NOTICE log level (25) is added to logging when utils.monkey_patch is executed. Depending on test execution order, this may not have happened when some unit tests run, so LogRecords at NOTICE level may have the default level name of 'Level 25'. FakeLogger doesn't have a key in its lines dict for 'Level 25', so those tests would blow up. Closes-Bug: #2034254 Related-Change: I6f35ad41414898fb7dc5da422f524eb52ff2940f Change-Id: I2945ae725f97ee56e9c7ad580168ec8091f2049a
This commit is contained in:
parent
af97975ace
commit
4a80963b40
@ -150,6 +150,9 @@ class FakeLogger(logging.Logger, CaptureLog):
|
||||
self.statsd_client = FakeStatsdClient("host", 8125)
|
||||
self.thread_locals = None
|
||||
self.parent = None
|
||||
# ensure the NOTICE level has been named, in case it has not already
|
||||
# been set
|
||||
logging.addLevelName(NOTICE, 'NOTICE')
|
||||
|
||||
store_in = {
|
||||
logging.ERROR: 'error',
|
||||
|
Loading…
x
Reference in New Issue
Block a user