logpolicy: add debug knob to force logging time to terminal

pull/832/head
Brad Fitzpatrick 2020-10-19 08:10:05 -07:00
parent 86c271caba
commit 6cc6e251a9
1 changed files with 3 additions and 0 deletions

View File

@ -315,6 +315,9 @@ func New(collection string) *Policy {
} else {
lflags = log.LstdFlags
}
if v, _ := strconv.ParseBool(os.Getenv("TS_DEBUG_LOG_TIME")); v {
lflags = log.LstdFlags | log.Lmicroseconds
}
if runningUnderSystemd() {
// If journalctl is going to prepend its own timestamp
// anyway, no need to add one.