From 1ed08c7384c25fbe6fdaa0c0e70f32adf5a49892 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Wed, 17 Oct 2018 22:32:48 +0200 Subject: [PATCH] tlog: disable color codes when switching to syslog When gocryptfs was started on a terminal and later daemonized, the color codes stayed active in the syslog output. The codes are not visible in "journalctl -f", which is why I have not noticed it yet, but they do show up in normal syslog as the usual "#033[33m" crap. --- internal/tlog/log.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/tlog/log.go b/internal/tlog/log.go index 9ebe535..0eee704 100644 --- a/internal/tlog/log.go +++ b/internal/tlog/log.go @@ -142,6 +142,9 @@ func (l *toggledLogger) SwitchToSyslog(p syslog.Priority) { Warn.Printf("SwitchToSyslog: %v", err) } else { l.Logger.SetOutput(w) + // Disable colors + l.prefix = "" + l.postfix = "" } }