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. 14
      korman/exporter/logger.py

14
korman/exporter/logger.py

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

Loading…
Cancel
Save