Browse Source

Fix issue with verbose logger not logging when there is no backing file

pull/125/head
Adam Johnson 6 years ago
parent
commit
8c0396839b
Signed by: Hoikas
GPG Key ID: 0B6515D6FF6F271E
  1. 4
      korman/exporter/logger.py

4
korman/exporter/logger.py

@ -48,11 +48,11 @@ class _ExportLogger:
def msg(self, *args, **kwargs): def msg(self, *args, **kwargs):
assert args assert args
if self._file is not None:
indent = kwargs.get("indent", 0) indent = kwargs.get("indent", 0)
msg = "{}{}".format(" " * indent, args[0]) msg = "{}{}".format(" " * indent, args[0])
if len(args) > 1: if len(args) > 1:
msg = msg.format(*args[1:], **kwargs) msg = msg.format(*args[1:], **kwargs)
if self._file is not None:
self._file.writelines((msg, "\n")) self._file.writelines((msg, "\n"))
if self._print_logs: if self._print_logs:
print(msg) print(msg)
@ -277,7 +277,7 @@ class ExportProgressLogger(_ExportLogger):
class ExportVerboseLogger(_ExportLogger): class ExportVerboseLogger(_ExportLogger):
def __init__(self, age_path): def __init__(self, age_path=None):
super().__init__(True, age_path) super().__init__(True, age_path)
self.progress_range = 0 self.progress_range = 0
self.progress_value = 0 self.progress_value = 0

Loading…
Cancel
Save