mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-23 11:12:47 +01:00
Eliminate unnecessary closing of the log file.
Name returns a string that is the log file name: the channel plus the timestamp. But on my system log.name returns the fully qualified path to the currently open file. This is because log is a file handle, so if you declare it with a path, it will be included in the name. On systems were logging is not in the current directory, the two will never match, and the file is closed and then reopened. Only taking the basename solves this problem.
This commit is contained in:
parent
b31ce87472
commit
ba0ba71bf4
@ -132,7 +132,7 @@ class ChannelLogger(callbacks.Plugin):
|
||||
for (channel, log) in logs.items():
|
||||
if self.registryValue('rotateLogs', channel):
|
||||
name = self.getLogName(channel)
|
||||
if name != log.name:
|
||||
if name != os.path.basename(log.name):
|
||||
log.close()
|
||||
del logs[channel]
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user