From b31bd3fa845126af18445e1db49b52301b7ff5e1 Mon Sep 17 00:00:00 2001 From: Brendan Howell Date: Fri, 13 Oct 2017 23:49:31 +0200 Subject: [PATCH] more informative formatting for printed logs --- screenless/bureau/bureau.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/screenless/bureau/bureau.py b/screenless/bureau/bureau.py index 0599187..20e85b8 100644 --- a/screenless/bureau/bureau.py +++ b/screenless/bureau/bureau.py @@ -101,7 +101,6 @@ class Bureau(object): self.load_config() # setup log file - # TODO: custom handler to print errors to small printer if hasattr(self.config, "debug"): if self.config.debug: log_level = logging.DEBUG @@ -113,6 +112,8 @@ class Bureau(object): logging.basicConfig(filename=logfile, level=log_level) self.log = logging.getLogger(self.prefix) log_printer = LogPrinter() + log_format = logging.Formatter('LOG ${levelname} $name: $message', style='$') + log_printer.setFormatter(log_format) self.log.addHandler(log_printer) # setup a dir to store files and data