log

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2026 License: Apache-2.0 Imports: 1 Imported by: 0 modules, 0 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 Noop = noop(0)

Noop logger doesn't log anything.

Variables

This section is empty.

Functions

func CtxWithValues

func CtxWithValues(parent context.Context, kv Kv) context.Context

CtxWithValues returns a copy of parent in which the key values passed have been stored ready to be used using log.Logger.

Types

type Kv

type Kv = map[string]interface{}

Kv is a helper type for structured logging fields usage.

func ValuesFromCtx

func ValuesFromCtx(ctx context.Context) Kv

ValuesFromCtx gets the log Key values from a context.

type Logger

type Logger interface {
	Infof(format string, args ...interface{})
	Warningf(format string, args ...interface{})
	Errorf(format string, args ...interface{})
	Debugf(format string, args ...interface{})
	WithValues(values map[string]interface{}) Logger
	WithCtxValues(ctx context.Context) Logger
	SetValuesOnCtx(parent context.Context, values map[string]interface{}) context.Context
}

Logger is the interface that the loggers used by the library will use.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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