Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Replacecdr.dev/slog with stdlibslog #7451

Closed as not planned
Closed as not planned
Assignees
ammario
@ammario

Description

@ammario

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 akvlog.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
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp