mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-23 02:49:27 +01:00
src/log.py: Display warning instead of raising exception if there is no space left on defice (infinite loop…).
This commit is contained in:
parent
bc7b9c62a0
commit
a138722d73
@ -136,7 +136,13 @@ class BetterFileHandler(logging.FileHandler):
|
||||
except UnicodeError:
|
||||
self.stream.write(msg.encode("utf8"))
|
||||
self.stream.write(os.linesep)
|
||||
self.flush()
|
||||
try:
|
||||
self.flush()
|
||||
except OSError as e:
|
||||
if e.args[0] == 28:
|
||||
print('No space left on device, cannot flush log.')
|
||||
else:
|
||||
raise
|
||||
|
||||
|
||||
class ColorizedFormatter(Formatter):
|
||||
|
Loading…
Reference in New Issue
Block a user