Closed hasnickl closed 7 years ago
It is useful to enable periodic metrics logging using metrics.Log() function, however it is hard coded to use the golang logger:
metrics.Log()
func Log(r Registry, freq time.Duration, l *log.Logger) { LogScaled(r, freq, time.Nanosecond, l) }
This function should use an interface to support metrics logging with any library:
type Logger interface { Printf(format string, v ...interface{}) } func Log(r Registry, freq time.Duration, l Logger) { LogScaled(r, freq, time.Nanosecond, l) }
This allows metrics logging to utilize any logging library that provides Printf()
Printf()
+1
TY for the fix
It is useful to enable periodic metrics logging using
metrics.Log()
function, however it is hard coded to use the golang logger:This function should use an interface to support metrics logging with any library:
This allows metrics logging to utilize any logging library that provides
Printf()