diff options
Diffstat (limited to 'obnamlib/app.py')
-rw-r--r-- | obnamlib/app.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/obnamlib/app.py b/obnamlib/app.py index 362ecf58..4505fc88 100644 --- a/obnamlib/app.py +++ b/obnamlib/app.py @@ -234,10 +234,14 @@ class App(cliapp.Application): sys.stderr.write('ERROR: %s\n' % str(e)) sys.exit(1) except obnamlib.StructuredError as e: - logging.critical(str(e), exc_info=True) + logging.critical(self._indent_multiline(e.formatted()), exc_info=True) sys.stderr.write('ERROR: %s\n' % e.formatted()) sys.exit(1) + def _indent_multiline(self, s): + lines = s.splitlines() + return ''.join([lines[0] + '\n'] + [' {}\n'.format(line) for line in lines[1:]]) + def setup_ttystatus(self): self.ts = ttystatus.TerminalStatus(period=0.1) if self.settings['quiet']: |