Optimize the reopen_files by using FileHandler's method: close & _open

This commit is contained in:
ysymi 2018-04-03 23:11:27 +08:00
parent 836b078752
commit e8c65c1414

View File

@ -377,9 +377,8 @@ class Logger(object):
handler.acquire() handler.acquire()
try: try:
if handler.stream: if handler.stream:
handler.stream.close() handler.close()
handler.stream = open(handler.baseFilename, handler.stream = handler._open()
handler.mode)
finally: finally:
handler.release() handler.release()