mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-22 18:52:45 +01:00
Merge pull request #540 from esplinr/master
ChannelLogger: Improvements to file handling.
This commit is contained in:
commit
1f2d51dfc5
@ -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]
|
||||
|
||||
@ -149,7 +149,7 @@ class ChannelLogger(callbacks.Plugin):
|
||||
try:
|
||||
name = self.getLogName(channel)
|
||||
logDir = self.getLogDir(irc, channel)
|
||||
log = open(os.path.join(logDir, name), 'a')
|
||||
log = open(os.path.join(logDir, name), encoding='utf-8', mode='a')
|
||||
logs[channel] = log
|
||||
return log
|
||||
except IOError:
|
||||
|
Loading…
Reference in New Issue
Block a user