MCPcopy
hub / github.com/harness/harness / UpdateContext

Function UpdateContext

logging/logging.go:29–38  ·  view source on GitHub ↗

UpdateContext updates the existing logging context in the context. IMPORTANT: No new context is created, all future logs with provided context will be impacted.

(ctx context.Context, opts ...Option)

Source from the content-addressed store, hash-verified

27// UpdateContext updates the existing logging context in the context.
28// IMPORTANT: No new context is created, all future logs with provided context will be impacted.
29func UpdateContext(ctx context.Context, opts ...Option) {
30 // updates existing logging context in provided context.Context
31 zerolog.Ctx(ctx).UpdateContext(func(c zerolog.Context) zerolog.Context {
32 for _, opt := range opts {
33 c = opt(c)
34 }
35
36 return c
37 })
38}
39
40// NewContext derives a new LoggingContext from the existing LoggingContext, adds the provided annotations,
41// and then returns a clone of the provided context.Context with the new LoggingContext.

Callers 1

HLogRequestIDHandlerFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…