logutil

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CtxLogKey interface{} = ctxLogKeyType{}

CtxLogKey is the key to retrieve logger from context. It can be assigned to another value.

Functions

func AssertWarn

func AssertWarn(logger *zap.Logger, msg string, fields ...zap.Field)

AssertWarn panics when in testing mode, and logs a warning msg otherwise.

func BgLogger

func BgLogger() *zap.Logger

BgLogger returns the default global logger.

func Logger

func Logger(ctx context.Context) *zap.Logger

Logger gets a contextual logger from current context. contextual logger will output common fields from context.

Types

This section is empty.

Jump to

Keyboard shortcuts

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