mirror of
https://github.com/vincentbernat/i3wm-configuration.git
synced 2025-07-10 18:24:22 +02:00
i3-companion: fix logging to console
This commit is contained in:
parent
34ac2d7268
commit
fb0bd7fcca
1 changed files with 2 additions and 1 deletions
|
@ -707,9 +707,10 @@ if __name__ == "__main__":
|
||||||
root = logging.getLogger("")
|
root = logging.getLogger("")
|
||||||
root.setLevel(logging.WARNING)
|
root.setLevel(logging.WARNING)
|
||||||
logger.setLevel(options.debug and logging.DEBUG or logging.INFO)
|
logger.setLevel(options.debug and logging.DEBUG or logging.INFO)
|
||||||
if sys.stdin.isatty():
|
if sys.stderr.isatty():
|
||||||
ch = logging.StreamHandler()
|
ch = logging.StreamHandler()
|
||||||
ch.setFormatter(logging.Formatter("%(levelname)s: %(message)s"))
|
ch.setFormatter(logging.Formatter("%(levelname)s: %(message)s"))
|
||||||
|
root.addHandler(ch)
|
||||||
else:
|
else:
|
||||||
root.addHandler(journal.JournalHandler(SYSLOG_IDENTIFIER=logger.name))
|
root.addHandler(journal.JournalHandler(SYSLOG_IDENTIFIER=logger.name))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue