fix: move to slog

Signed-off-by: Michael Todorovic <michael.todorovic@outlook.com>
This commit is contained in:
Michael Todorovic 2024-11-18 10:54:21 +01:00
parent f2fe2d176b
commit f682fed50c
No known key found for this signature in database
GPG Key ID: 639C573EC58E6099
2 changed files with 7 additions and 6 deletions

View File

@ -18,7 +18,8 @@ import (
"fmt" "fmt"
"strings" "strings"
"github.com/go-kit/log" "log/slog"
"github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus"
) )
@ -27,7 +28,7 @@ func init() {
} }
type PGIndexCollector struct { type PGIndexCollector struct {
log log.Logger log *slog.Logger
} }
const pgIndexSubsystem = "index" const pgIndexSubsystem = "index"

View File

@ -18,9 +18,9 @@ import (
"fmt" "fmt"
"strings" "strings"
"log/slog"
"github.com/blang/semver/v4" "github.com/blang/semver/v4"
"github.com/go-kit/log"
"github.com/go-kit/log/level"
"github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus"
) )
@ -29,7 +29,7 @@ func init() {
} }
type PGStatUserIndexesCollector struct { type PGStatUserIndexesCollector struct {
log log.Logger log *slog.Logger
} }
const statUserIndexesSubsystem = "stat_user_indexes" const statUserIndexesSubsystem = "stat_user_indexes"
@ -137,7 +137,7 @@ func (c *PGStatUserIndexesCollector) Update(ctx context.Context, instance *insta
} }
if lastIdxScanAvail && !lastIdxScan.Valid { if lastIdxScanAvail && !lastIdxScan.Valid {
level.Debug(c.log).Log("msg", "Skipping collecting metric because it has no active_time") c.log.Debug("Skipping collecting metric because it has no active_time")
continue continue
} }