From fb0bd7fcca6b688102c38da9b9a3b9f1fdd036c3 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Mon, 12 Jul 2021 21:17:25 +0200 Subject: [PATCH] i3-companion: fix logging to console --- bin/i3-companion | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/i3-companion b/bin/i3-companion index eaa1585..660a748 100755 --- a/bin/i3-companion +++ b/bin/i3-companion @@ -707,9 +707,10 @@ if __name__ == "__main__": root = logging.getLogger("") root.setLevel(logging.WARNING) logger.setLevel(options.debug and logging.DEBUG or logging.INFO) - if sys.stdin.isatty(): + if sys.stderr.isatty(): ch = logging.StreamHandler() ch.setFormatter(logging.Formatter("%(levelname)s: %(message)s")) + root.addHandler(ch) else: root.addHandler(journal.JournalHandler(SYSLOG_IDENTIFIER=logger.name))