level

package
v0.27.2 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(logger log.Logger) log.Logger

Debug returns a logger that includes a Key/DebugValue pair.

func Error

func Error(logger log.Logger) log.Logger

Error returns a logger that includes a Key/ErrorValue pair.

func Info

func Info(logger log.Logger) log.Logger

Info returns a logger that includes a Key/InfoValue pair.

func SetLogLevel

func SetLogLevel(level string) error

SetLogLevel sets the log level.

func Warn

func Warn(logger log.Logger) log.Logger

Warn returns a logger that includes a Key/WarnValue pair.

Types

type EmptyLogger

type EmptyLogger struct{}

func (*EmptyLogger) Log

func (l *EmptyLogger) Log(keyvals ...interface{}) error

type Level

type Level int

A Level is a logging priority. Higher levels are more important.

const (
	// LevelDebug logs are typically voluminous, and are usually disabled in
	// production.
	LevelDebug Level = iota
	// LevelInfo is the default logging priority.
	LevelInfo
	// LevelWarn logs are more important than Info, but don't need individual
	// human review.
	LevelWarn
	// LevelError logs are high-priority. If an application is running smoothly,
	// it shouldn't generate any error-level logs.
	LevelError
)

Jump to

Keyboard shortcuts

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