summaryrefslogtreecommitdiff
path: root/internal/tlog
diff options
context:
space:
mode:
authorJakob Unterwurzacher2018-10-17 22:32:48 +0200
committerJakob Unterwurzacher2018-10-17 22:34:30 +0200
commit1ed08c7384c25fbe6fdaa0c0e70f32adf5a49892 (patch)
treee3038f21ac6ad5e592c95cd3311389804ab66fa4 /internal/tlog
parent4cdf6b9af94232912857138cc1ddcec520d9ceca (diff)
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.
Diffstat (limited to 'internal/tlog')
-rw-r--r--internal/tlog/log.go3
1 files changed, 3 insertions, 0 deletions
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 = ""
}
}