MCPcopy Create free account
hub / github.com/coder/agentapi / From

Function From

lib/logctx/logctx.go:20–25  ·  view source on GitHub ↗

From retrieves the logger from the context or panics if no logger is found

(ctx context.Context)

Source from the content-addressed store, hash-verified

18
19// From retrieves the logger from the context or panics if no logger is found
20func From(ctx context.Context) *slog.Logger {
21 if logger, ok := ctx.Value(loggerKey).(*slog.Logger); ok {
22 return logger
23 }
24 panic("no logger found in context")
25}
26
27// plucked from log/slog
28// remove once we update to go 1.24

Callers 4

SetupProcessFunction · 0.92
SetupACPFunction · 0.92
NewServerFunction · 0.92
StartProcessFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected