Commit 3d69e526 authored by Julien Muchembled's avatar Julien Muchembled

logs: fix race condition when resetting logger

git-svn-id: https://svn.erp5.org/repos/neo/trunk@2747 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 002558b6
...@@ -40,7 +40,11 @@ def setupLog(name='NEO', filename=None, verbose=False): ...@@ -40,7 +40,11 @@ def setupLog(name='NEO', filename=None, verbose=False):
level = logging_std.INFO level = logging_std.INFO
if logging is not None: if logging is not None:
for handler in logging.handlers: for handler in logging.handlers:
handler.acquire()
try:
handler.close() handler.close()
finally:
handler.release()
del logging.manager.loggerDict[logging.name] del logging.manager.loggerDict[logging.name]
logging = logging_std.getLogger(name) logging = logging_std.getLogger(name)
for handler in logging.handlers[:]: for handler in logging.handlers[:]:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment