Skip to content

Commit 51aa663

Browse files
authored
Merge pull request #239 from bobrik/ivan/no-timestamps
Allow suppressing timestamps in logs
2 parents a03c1b3 + 0c74866 commit 51aa663

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

cmd/ebpf_exporter/main.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ func main() {
2222
configDir := kingpin.Flag("config.dir", "Config dir path.").Required().ExistingDir()
2323
configNames := kingpin.Flag("config.names", "Comma separated names of configs to load.").Required().String()
2424
debug := kingpin.Flag("debug", "Enable debug.").Bool()
25+
noLogTime := kingpin.Flag("log.no-timestamps", "Disable timestamps in log.").Bool()
2526
listenAddress := kingpin.Flag("web.listen-address", "The address to listen on for HTTP requests (fd://0 for systemd activation).").Default(":9435").String()
2627
metricsPath := kingpin.Flag("web.telemetry-path", "Path under which to expose metrics.").Default("/metrics").String()
2728
kingpin.Version(version.Print("ebpf_exporter"))
@@ -35,6 +36,10 @@ func main() {
3536
})
3637
}
3738

39+
if *noLogTime {
40+
log.SetFlags(log.Flags() &^ (log.Ldate | log.Ltime))
41+
}
42+
3843
libbpfgo.SetLoggerCbs(libbpfgoCallbacks)
3944

4045
started := time.Now()

0 commit comments

Comments
 (0)