mirror of
https://git.yoctoproject.org/poky
synced 2026-04-18 21:32:12 +02:00
bitbake: knotty/msg: Use logging.shutdown() instead of bb.msg.cleanupLogging()
The logging module provides a shutdown() function that does the same thing in a much better way (Bitbake rev: 970cd2fc4f0bbc93069dee5a15a608dd76081c67) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
5ce50b3ce7
commit
bf7d68c812
@@ -330,14 +330,3 @@ def setLoggingConfig(defaultconfig, userconfigfile=None):
|
||||
# bb.msg.loggerDefaultLogLevel = newlevel
|
||||
|
||||
return conf
|
||||
|
||||
def cleanupLogging():
|
||||
# Iterate through all the handlers and close them if possible. Fixes
|
||||
# 'Unclosed resource' warnings when bitbake exits, see
|
||||
# https://bugs.python.org/issue23010
|
||||
handlers = set()
|
||||
for logger_iter in logging.Logger.manager.loggerDict.keys():
|
||||
handlers.update(logging.getLogger(logger_iter).handlers)
|
||||
|
||||
for h in handlers:
|
||||
h.close()
|
||||
|
||||
@@ -871,6 +871,6 @@ def main(server, eventHandler, params, tf = TerminalFilter):
|
||||
if e.errno == errno.EPIPE:
|
||||
pass
|
||||
|
||||
bb.msg.cleanupLogging()
|
||||
logging.shutdown()
|
||||
|
||||
return return_value
|
||||
|
||||
Reference in New Issue
Block a user