MCPcopy Create free account
hub / github.com/prometheus/common / NewDynamicWithLogger

Function NewDynamicWithLogger

promlog/log.go:150–161  ·  view source on GitHub ↗

NewDynamicWithLogger returns a new leveled logger with a custom io.Writer. Each logged line will be annotated with a timestamp. Some properties can be changed, like the level.

(l log.Logger, config *Config)

Source from the content-addressed store, hash-verified

148// Each logged line will be annotated with a timestamp.
149// Some properties can be changed, like the level.
150func NewDynamicWithLogger(l log.Logger, config *Config) *logger {
151 lo := &logger{
152 base: l,
153 leveled: l,
154 }
155
156 if config.Level != nil {
157 lo.SetLevel(config.Level)
158 }
159
160 return lo
161}
162
163type logger struct {
164 base log.Logger

Callers 1

NewDynamicFunction · 0.85

Calls 1

SetLevelMethod · 0.95

Tested by

no test coverage detected