logger

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Version string

Version is set at build time via ldflags.

Functions

func Close

func Close(ctx context.Context)

Close flushes the logger, ignoring the sync error that is expected on stderr-based loggers (see https://github.com/uber-go/zap/issues/880).

func ConfigureDevelopmentLogger

func ConfigureDevelopmentLogger(ctx context.Context, logLevel string) (context.Context, error)

ConfigureDevelopmentLogger creates a zap development logger at the given level, stores it in the returned context, and returns the context. Logs are written to stderr so they don't corrupt piped stdout output.

Types

type Field

type Field = zap.Field

Field is a type alias for zap.Field so callers use logger.Field transparently.

func Any

func Any(key string, val any) Field

func Err

func Err(err error) Field

func Int

func Int(key string, val int) Field

func String

func String(key, val string) Field

func Strings

func Strings(key string, val []string) Field

type Logger

type Logger struct {
	*zap.Logger
}

Logger wraps a *zap.Logger.

func L

func L(ctx context.Context) *Logger

L retrieves the logger from context. Returns a no-op logger if none is set.

Jump to

Keyboard shortcuts

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