ctxlog

package
v0.4.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 15, 2026 License: Apache-2.0 Imports: 3 Imported by: 3 modules, 4 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	CtxKeyLog = CtxKey("log")
)

Variables

This section is empty.

Functions

func LogcFromCtx

func LogcFromCtx(ctx context.Context, opts ...LogOption) log.Logger

func Logger

func Logger(ctx context.Context, opts ...LogOption) log.Logger

Logger get logger from the context. By default, it uses "log" key. use WithLogName("<custom name>") to set custom key If logger not found dummyLogger is returned

func LogrFromCtx

func LogrFromCtx(ctx context.Context) logr.Logger

func WithLogc

func WithLogc(ctx context.Context, lg log.Logger, opts ...LogOption) context.Context

WithLogc add logger object to the context key defaults to the "log" use WithLogName("<custom name>") to set custom key

func WithLogger

func WithLogger(ctx context.Context, lg log.Logger, opts ...LogOption) context.Context

WithLogger add logger object to the context key defaults to the "log" use WithLogName("<custom name>") to set custom key

Types

type CtxKey

type CtxKey string

type LogOption

type LogOption func(*options) error

func WithLogName

func WithLogName(val string) LogOption

WithLogName set custom name of the log object

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL