Skip to content

Commit

Permalink
style: ensure slogging uses attributes only (#3197)
Browse files Browse the repository at this point in the history
  • Loading branch information
cgrinds authored Oct 7, 2024
1 parent 3fafe47 commit bfb85f3
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,5 @@ linters-settings:
- whyNoLint
dogsled:
max-blank-identifiers: 3
sloglint:
attr-only: true
2 changes: 1 addition & 1 deletion cmd/collectors/storagegrid/rest/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func NewClient(pollerName string, clientTimeout string, c *auth.Credentials) (*C
timeout, _ = time.ParseDuration(DefaultTimeout)
}
if client, err = New(poller, timeout, c); err != nil {
return nil, fmt.Errorf("uanble to create poller [%s]. err: %w", pollerName, err)
return nil, fmt.Errorf("unable to create poller [%s]. err: %w", pollerName, err)
}

return client, err
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func (p *QosPolicyAdaptive) Run(dataMap map[string]*matrix.Matrix) ([]*matrix.Ma
for _, k := range metrics {
err := matrix.CreateMetric(k, data)
if err != nil {
p.SLogger.Error("error while creating metric", "key", k, "err", err)
p.SLogger.Error("error while creating metric", slog.Any("err", err), slog.String("key", k))
return nil, nil, err
}
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/collectors/zapiperf/plugins/disk/disk.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ func (d *Disk) Init() error {
d.shelfData[attribute].SetExportOptions(exportOptions)
}

d.SLogger.Debug("initialized with shelfData", "objects", len(d.shelfData))
d.SLogger.Debug("initialized with shelfData", slog.Int("objects", len(d.shelfData)))

// setup batchSize for request
d.batchSize = batchSize
Expand Down

0 comments on commit bfb85f3

Please sign in to comment.