logging

package
v0.0.0-...-724c7a8 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2022 License: EUPL-1.2 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetLevel

func SetLevel(new Level)

SetLevel sets the logging level globally.

func ToJSON

func ToJSON(v interface{}) string

func ToPrettyJSON

func ToPrettyJSON(v interface{}) string

Types

type Level

type Level uint8

Level represents the logging level.

const (
	LevelTrace Level = iota
	LevelDebug
	LevelInfo
	LevelWarn
	LevelError
	LevelOff
)

func GetLevel

func GetLevel() Level

GetLevel retrieves the current global logging level.

type Logger

type Logger interface {
	// Trace emits a message at the TRACE level.
	Trace(format string, args ...interface{})

	// Debug emits a message at the DEBUG level.
	Debug(format string, args ...interface{})

	// Info emits a message at the INFO level.
	Info(format string, args ...interface{})

	// Warn emits a message at the WARN level.
	Warn(format string, args ...interface{})

	// Error emits a message at the ERROR level.
	Error(format string, args ...interface{})
}

Logger is the common interface to all loggers.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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