-
Notifications
You must be signed in to change notification settings - Fork 770
--log.level has no effect #557
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
I think this regressed between 0.8.0 and 0.10.0. This commit was made prior to the release of 0.10.0:
and I think this reproduces the problem: package main
import (
"github.com/go-kit/kit/log/level"
// "github.com/go-kit/log/level"
"github.com/prometheus/common/promlog"
)
func main() {
v := promlog.AllowedLevel{}
v.Set("warn")
c := &promlog.Config{Level: &v}
l := promlog.New(c)
level.Debug(l).Log("msg", "debug")
level.Info(l).Log("msg", "info")
level.Warn(l).Log("msg", "warn")
level.Error(l).Log("msg", "error")
} The program above will output:
But if we swap those diff --git a/main.go b/main.go
index 297bf8a..faabbb5 100644
--- a/main.go
+++ b/main.go
@@ -1,8 +1,8 @@
package main
import (
- "github.com/go-kit/kit/log/level"
- // "github.com/go-kit/log/level"
+ // "github.com/go-kit/kit/log/level"
+ "github.com/go-kit/log/level"
"github.com/prometheus/common/promlog"
)
then we get desired behaviour:
I have no idea what is going on with go-kit/kit. Looks like they've moved some stuff around. |
Same issue here :/ |
Having same issue, in fact not setting any |
Uh oh!
There was an error while loading. Please reload this page.
What did you do?
Set
--log.level=warn
.What did you expect to see?
No messages logged at
debug
level.What did you see instead? Under which circumstances?
Messages logged at
debug
level. Under all circumstances.Environment
postgres_exporter version:
This is
quay.io/prometheuscommunity/postgres-exporter:v0.10.0
.postgres_exporter flags:
The text was updated successfully, but these errors were encountered: