8000 chore(go.mod): update cdr.dev/slog by mafredri · Pull Request #7994 · coder/coder · GitHub
[go: up one dir, main page]

Skip to content

chore(go.mod): update cdr.dev/slog #7994

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 13, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix: change uses of []slog.Field to []any
  • Loading branch information
mafredri committed Jun 13, 2023
commit a533b1c1848a4cf5b7ad77867bdf051bdf285c2b
2 changes: 1 addition & 1 deletion coderd/csp.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func (api *API) logReportCSPViolations(rw http.ResponseWriter, r *http.Request)
return
}

fields := make([]slog.Field, 0, len(v.Report))
fields := make([]any, 0, len(v.Report))
for k, v := range v.Report {
fields = append(fields, slog.F(k, v))
}
Expand Down
2 changes: 1 addition & 1 deletion enterprise/audit/backends/slog.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func (b slogBackend) Export(ctx context.Context, alog database.AuditLog) error {
// pleasantly format the output. For example, the clean result of
// (*NullString).Value() may be printed instead of {String: "foo", Valid: true}.
sfs := structs.Fields(alog)
var fields []slog.Field
var fields []any
for _, sf := range sfs {
fields = append(fields, slog.F(sf.Name(), sf.Value()))
}
Expand Down
2 changes: 1 addition & 1 deletion provisionerd/provisionerd.go
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ func (p *Server) acquireJob(ctx context.Context) {
))
defer span.End()

fields := []slog.Field{
fields := []any{
slog.F("initiator_username", job.UserName),
slog.F("provisioner", job.Provisioner),
slog.F("job_id", job.JobId),
Expand Down
2 changes: 1 addition & 1 deletion provisionerd/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -1167,7 +1167,7 @@ func redactVariableValues(variableValues []*sdkproto.VariableValue) []*sdkproto.
}

// logProvisionerJobLog logs a message from the provisioner daemon at the appropriate level.
func (r *Runner) logProvisionerJobLog(ctx context.Context, logLevel sdkproto.LogLevel, msg string, fields ...slog.Field) {
func (r *Runner) logProvisionerJobLog(ctx context.Context, logLevel sdkproto.LogLevel, msg string, fields ...any) {
switch logLevel {
case sdkproto.LogLevel_TRACE:
r.logger.Debug(ctx, msg, fields...) // There's no trace, so we'll just use debug.
Expand Down
0