ctxlog

package
v0.30.1 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 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 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