CtxLogger pulls the logger out of the context, or the default logger if not found.
(ctx context.Context)
| 75 | // CtxLogger pulls the logger out of the context, or the default logger if not |
| 76 | // found. |
| 77 | func 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. |
| 86 | func CtxSetPublicKey(parent ssh.Context, pk *models.PublicKey) { |
no outgoing calls