mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 19:21:50 +00:00
I don't see many uses of log.WithTrace, but I think this is because it
is clunky to use since Span or Context may be nil on a context. This
introduces a helper so we can start logging against a span more easily.
Here is an example of using it I want:
logger := trace.Logger(ctx, s.Log).Scoped("...", "...").With(...
This seems like the best place to add the logger, since we need to use
internal functions in the trace pkg (ie won't work in lib/log).
I updated the documentation to include an example of it. Right now the
documentation has one other place it calls WithTrace, but it needs to be
reworked to be more realistic. I think calling log.Scoped on something
that is traced seems surprising to me.
Test Plan: unused, so just that CI is happy.
Co-authored-by: Robert Lin <robert@bobheadxi.dev>
|
||
|---|---|---|
| .. | ||
| _resources | ||
| admin | ||
| adopt | ||
| api | ||
| batch_changes | ||
| cli | ||
| cloud | ||
| code_insights | ||
| code_intelligence | ||
| code_monitoring | ||
| code_search | ||
| dev | ||
| extensions | ||
| getting-started | ||
| integration | ||
| notebooks | ||
| CHANGELOG.md | ||
| CODENOTIFY | ||
| dependency_decisions.yml | ||
| docsite.json | ||
| index.md | ||
| sidebar.md | ||