From 7f8a275ab8e3b31a5c013d76b182d97b74a606d6 Mon Sep 17 00:00:00 2001 From: Matt Robenolt Date: Thu, 17 Jun 2021 16:03:57 -0700 Subject: [PATCH] printer: Make time_format optional --- honcho/printer.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/honcho/printer.py b/honcho/printer.py index 94f7ab2..3e184ae 100644 --- a/honcho/printer.py +++ b/honcho/printer.py @@ -54,8 +54,11 @@ def write(self, message): for line in string.splitlines(): prefix = '' if self.prefix: - time_formatted = message.time.strftime(self.time_format) - prefix = '{time} {name}| '.format(time=time_formatted, name=name) + if self.time_format: + time_formatted = message.time.strftime(self.time_format) + prefix = '{time} {name}| '.format(time=time_formatted, name=name) + else: + prefix = '{name}| '.format(name=name) if self.colour and self._colours_supported and message.colour: prefix = _colour_string(message.colour, prefix) print(prefix + line, file=self.output, flush=True)