Skip to content

Backend: add scoped `log.Field` encoder

Warren Gifford requested to merge cc/add-scoped into main

Created by: camdencheek

This adds the function trace.Scoped() to the utility functions for trace fields. This returns a lazy logger that adds a scope to each of the fields so they are emitted with the key scope.originalKey rather than just originalKey. The purpose of this is so I can nest logical sub-fields in traces.

Test plan

Manually tested as part of https://github.com/sourcegraph/sourcegraph/pull/38350

Merge request reports

Loading