remove timestamp from logging if started via systemd
This commit is contained in:
parent
220ce63d95
commit
3966020cfe
1 changed files with 6 additions and 2 deletions
|
@ -16,8 +16,12 @@ import (
|
||||||
var FlagDebug bool
|
var FlagDebug bool
|
||||||
|
|
||||||
func InitializeLogger() {
|
func InitializeLogger() {
|
||||||
|
if os.Getenv("INVOCATION_ID") == "" {
|
||||||
log.Logger = log.Output(zerolog.ConsoleWriter{Out: os.Stdout, TimeFormat: time.RFC3339})
|
// detect systemd
|
||||||
|
log.Logger = log.Output(zerolog.ConsoleWriter{Out: os.Stdout, TimeFormat: time.RFC3339})
|
||||||
|
} else {
|
||||||
|
log.Logger = log.Output(zerolog.ConsoleWriter{Out: os.Stdout, NoColor: true, PartsExclude: []string{"time"}})
|
||||||
|
}
|
||||||
|
|
||||||
if FlagDebug {
|
if FlagDebug {
|
||||||
zerolog.SetGlobalLevel(zerolog.DebugLevel)
|
zerolog.SetGlobalLevel(zerolog.DebugLevel)
|
||||||
|
|
Loading…
Reference in a new issue