logger: Use an option_fd when we know open can fail.
This commit is contained in:
parent
c55759e001
commit
eb89a5252a
1 changed files with 4 additions and 3 deletions
|
@ -192,9 +192,10 @@ class Logger:
|
||||||
if jid in self._fds.keys():
|
if jid in self._fds.keys():
|
||||||
fd = self._fds[jid]
|
fd = self._fds[jid]
|
||||||
else:
|
else:
|
||||||
fd = self._check_and_create_log_dir(jid)
|
option_fd = self._check_and_create_log_dir(jid)
|
||||||
if not fd:
|
if option_fd is None:
|
||||||
return True
|
return True
|
||||||
|
fd = option_fd
|
||||||
filename = log_dir / jid
|
filename = log_dir / jid
|
||||||
try:
|
try:
|
||||||
fd.write(logged_msg)
|
fd.write(logged_msg)
|
||||||
|
|
Loading…
Reference in a new issue