-
Notifications
You must be signed in to change notification settings - Fork 18
Description
A log message usually have a description, which is not key=value format, such as:
successfully created an object, name=obj1
Translate to go-kit log format:
msg="successfully created an object" name=obj1
The key "msg" can be fixed.
Something like Log(msg string, keysAndValues ...interface{})
In prometheus code: https://github.com/prometheus/prometheus/blob/main/tsdb/head.go#L466-L491
level.Info(h.logger).Log("msg", "Replaying on-disk memory mappable chunks if any")
level.Info(h.logger).Log("msg", "Chunk snapshot is enabled, replaying from the snapshot")
level.Info(h.logger).Log("msg", "Chunk snapshot loading time", "duration", time.Since(start).String())
level.Error(h.logger).Log("msg", "Failed to load chunk snapshot", "err", err)
The key "msg" is redundant here.