Settings

Theme

Go Things I Like: slog and clog

github.com

2 points by ImJasonH a year ago · 3 comments

Reader

lcof a year ago

I wonder if the overhead of using context values is noticeable in the context of logging. I guess you want to reconstruct the logger only when needed, kind of lazily

  • ImJasonHOP a year ago

    It might be noticeable at extreme levels, which I've never come anywhere to noticing.

    I tend to only use `log := clog.FromContext(ctx)` once at the top of a method, and not `clog.InfoContext(ctx, "...")`, but that's mostly for style reasons and not performance.

    • lcof a year ago

      Who’s up for a micro-benchmark? Jk, will definitely consider it

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection