Skip to content
This repository was archived by the owner on Aug 23, 2023. It is now read-only.

Commit e7277ec

Browse files
committed
work around log lib inefficiencies #123
see raintank/grafana@508cc44 grafana/grafana#4055
1 parent 23f7489 commit e7277ec

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

metric_tank/metric_tank.go

+17
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,23 @@ func main() {
128128
}
129129

130130
log.NewLogger(0, "console", fmt.Sprintf(`{"level": %d, "formatting":true}`, *logLevel))
131+
// workaround for https://github.com/grafana/grafana/issues/4055
132+
switch *logLevel {
133+
case 0:
134+
log.Level(log.TRACE)
135+
case 1:
136+
log.Level(log.DEBUG)
137+
case 2:
138+
log.Level(log.INFO)
139+
case 3:
140+
log.Level(log.WARN)
141+
case 4:
142+
log.Level(log.ERROR)
143+
case 5:
144+
log.Level(log.CRITICAL)
145+
case 6:
146+
log.Level(log.FATAL)
147+
}
131148

132149
if *showVersion {
133150
fmt.Println("metrics_tank")

0 commit comments

Comments
 (0)