Skip to content

Commit

Permalink
fix: set clampLevel to 3 for debug logs (#233)
Browse files Browse the repository at this point in the history
  • Loading branch information
burningalchemist committed Apr 18, 2023
1 parent 28624db commit dd3d237
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cmd/sql_exporter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const (
envConfigFile = "SQLEXPORTER_CONFIG"
envDebug = "SQLEXPORTER_DEBUG"
httpReadHeaderTimeout = time.Duration(time.Second * 60)
debugMaxLevel = 3
)

var (
Expand Down Expand Up @@ -59,6 +60,7 @@ func main() {
// Thus we need to pass it our go-kit logger object.
logger := promlog.New(promlogConfig)
klog.SetLogger(logger)
klog.ClampLevel(debugMaxLevel)

// Override --alsologtostderr default value.
if alsoLogToStderr := flag.Lookup("alsologtostderr"); alsoLogToStderr != nil {
Expand Down

0 comments on commit dd3d237

Please sign in to comment.