Package list golang-github-go-kit-kit / 0ebe168
log/experimental_level: level key should be prefixed Peter Bourgon 4 years ago
1 changed file(s) with 4 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
4848
4949 // Error returns a logger with the level key set to ErrorLevelValue.
5050 func Error(logger log.Logger) log.Logger {
51 return log.NewContext(logger).With(levelKey, errorLevelValue)
51 return log.NewContext(logger).WithPrefix(levelKey, errorLevelValue)
5252 }
5353
5454 // Warn returns a logger with the level key set to WarnLevelValue.
5555 func Warn(logger log.Logger) log.Logger {
56 return log.NewContext(logger).With(levelKey, warnLevelValue)
56 return log.NewContext(logger).WithPrefix(levelKey, warnLevelValue)
5757 }
5858
5959 // Info returns a logger with the level key set to InfoLevelValue.
6060 func Info(logger log.Logger) log.Logger {
61 return log.NewContext(logger).With(levelKey, infoLevelValue)
61 return log.NewContext(logger).WithPrefix(levelKey, infoLevelValue)
6262 }
6363
6464 // Debug returns a logger with the level key set to DebugLevelValue.
6565 func Debug(logger log.Logger) log.Logger {
66 return log.NewContext(logger).With(levelKey, debugLevelValue)
66 return log.NewContext(logger).WithPrefix(levelKey, debugLevelValue)
6767 }
6868
6969 // Config parameterizes the leveled logger.