Search and commands

↑ ↓ to select · Enter to open · Esc to close

Type to search packages.

logging

v1.0.0
edholm.dev/go-logging

Documentation

pkg.go.dev ↗

Table of contents

↓ to select · Enter to jump· Shift+Enter for source

6 matches

Top ↑

Functions

DefaultLogger

func DefaultLogger() logr.Logger

DefaultLogger gives you a logger with the default settings replied.

FromContext

func FromContext(ctx context.Context) logr.Logger

FromContext returns the logger stored within the context. If no logger is stored, the default logger is returned.

NewLogger

func NewLogger(verbosityLevel int, development bool) logr.Logger

NewLogger creates a new logger with the given configuration.

NewLoggerFromEnv

func NewLoggerFromEnv() logr.Logger

NewLoggerFromEnv creates a new logger from the environment. It consumes LOG_LEVEL for determining the level and LOG_MODE for determining the output parameters.

WithLogger

func WithLogger(ctx context.Context, logger logr.Logger) context.Context

WithLogger creates a new context with the given logger attached.

Dependency graph