- Notifications
You must be signed in to change notification settings - Fork1k
Closed as not planned
Description
With the advent of Go's officialslog to be released in 1.21, it's clear that ourslog is outdated and should be retired. The std slog's API is more ergonomic and we should expect the Go ecosystem to centralize around it, as it has done with most other standard library packages.
Fortunately, there is a graceful migration path for Coder:
- Replace Human JSON output withlogfmt, used by std slog, zerolog, and others. This will improve performance by ~10x and make our output far more readable.
- Add a
kvlog.Logger
type that wraps aslog.Logger
with akeyAndArgs ...interface{}
calling signature, so we can migrate portions of our codebase to the.Info("some message", "user_id", userID")
format adopted by std slog. - Lower priority: remove context from Log calls where unnecessary
This approach gives us optionality. If stdslog
fails or is rejected, we get some nice API improvements. If it succeeds, moving to a the new logger is 90% search-and-replace and far less risky.
Metadata
Metadata
Assignees
Labels
No labels