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()
try:
if handler.stream:
handler.stream.close()
handler.stream = open(handler.baseFilename,
handler.mode)
handler.close()
handler.stream = handler._open()
finally:
handler.release()