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.
This commit is contained in:
Jakob Unterwurzacher 2018-10-17 22:32:48 +02:00
parent 4cdf6b9af9
commit 1ed08c7384
1 changed files with 3 additions and 0 deletions

View File

@ -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 = ""
}
}