Skip to content

Commit

Permalink
tlog: disable color codes when switching to syslog
Browse files Browse the repository at this point in the history
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 "#33[33m" crap.
  • Loading branch information
rfjakob committed Oct 17, 2018
1 parent 4cdf6b9 commit 1ed08c7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/tlog/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ""
}
}

Expand Down

0 comments on commit 1ed08c7

Please sign in to comment.