MCPcopy Create free account
hub / github.com/belak/gitdir / CtxLogger

Function CtxLogger

context.go:77–83  ·  view source on GitHub ↗

CtxLogger pulls the logger out of the context, or the default logger if not found.

(ctx context.Context)

Source from the content-addressed store, hash-verified

75// CtxLogger pulls the logger out of the context, or the default logger if not
76// found.
77func CtxLogger(ctx context.Context) *zerolog.Logger {
78 if ctxLog, ok := ctx.Value(contextKeyLogger).(*zerolog.Logger); ok {
79 return ctxLog
80 }
81
82 return &log.Logger
83}
84
85// CtxSetPublicKey puts the given public key into the ssh.Context.
86func CtxSetPublicKey(parent ssh.Context, pk *models.PublicKey) {

Callers 4

TestCtxLoggerFunction · 0.85
handlePublicKeyMethod · 0.85
handleSessionMethod · 0.85
CtxExtractFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestCtxLoggerFunction · 0.68