log

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fields

type Fields map[string]string

Fields defines fields to attach to log msgs

type Logger

type Logger interface {
	SetLevel(string)
	With(Fields) *logger
	WithContext(context.Context) context.Context

	Errorf(string, ...interface{})
	Infof(string, ...interface{})
	Warnf(string, ...interface{})
	Debugf(string, ...interface{})
}

Logger provides an interface for all used logger features regardless of logging backend

func FromContext

func FromContext(ctx context.Context) Logger

FromContext returns a Logger from a context if it exists

func NewLogger

func NewLogger(out io.Writer) Logger

NewLogger returns a new Logger

Jump to

Keyboard shortcuts

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