Skip to content

Commit 508cc44

Browse files
committed
allow setting level on logger.
performance workaround, see grafana#4055
1 parent 958a1dd commit 508cc44

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pkg/log/log.go

+9
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,15 @@ func NewLogger(bufLen int64, mode, config string) {
3535
}
3636
}
3737

38+
// this helps you work around the performance annoyance mentioned in
39+
// https://github.com/grafana/grafana/issues/4055
40+
// until we refactor this library completely
41+
func Level(level LogLevel) {
42+
for i := range loggers {
43+
loggers[i].level = level
44+
}
45+
}
46+
3847
func Trace(format string, v ...interface{}) {
3948
for _, logger := range loggers {
4049
logger.Trace(format, v...)

0 commit comments

Comments
 (0)