Skip to content

Commit

Permalink
Don't log timestamps if run under systemd
Browse files Browse the repository at this point in the history
  • Loading branch information
artyom committed Dec 3, 2020
1 parent c34bb66 commit bb9fef4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ func main() {
}

log := log.New(os.Stderr, "", log.LstdFlags)
if os.Getppid() == 1 && os.Getenv("INVOCATION_ID") != "" {
log.SetFlags(0) // systemd takes care of log line timestamps
}

log.Println("loading data from", args.File)
begin := time.Now()
Expand Down

0 comments on commit bb9fef4

Please sign in to comment.