Skip to content

Commit

Permalink
Merge pull request #239 from bobrik/ivan/no-timestamps
Browse files Browse the repository at this point in the history
Allow suppressing timestamps in logs
  • Loading branch information
bobrik authored Jul 21, 2023
2 parents a03c1b3 + 0c74866 commit 51aa663
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/ebpf_exporter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ func main() {
configDir := kingpin.Flag("config.dir", "Config dir path.").Required().ExistingDir()
configNames := kingpin.Flag("config.names", "Comma separated names of configs to load.").Required().String()
debug := kingpin.Flag("debug", "Enable debug.").Bool()
noLogTime := kingpin.Flag("log.no-timestamps", "Disable timestamps in log.").Bool()
listenAddress := kingpin.Flag("web.listen-address", "The address to listen on for HTTP requests (fd://0 for systemd activation).").Default(":9435").String()
metricsPath := kingpin.Flag("web.telemetry-path", "Path under which to expose metrics.").Default("/metrics").String()
kingpin.Version(version.Print("ebpf_exporter"))
Expand All @@ -35,6 +36,10 @@ func main() {
})
}

if *noLogTime {
log.SetFlags(log.Flags() &^ (log.Ldate | log.Ltime))
}

libbpfgo.SetLoggerCbs(libbpfgoCallbacks)

started := time.Now()
Expand Down

0 comments on commit 51aa663

Please sign in to comment.