logger

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(v ...any)

Debug calls the Println method of the logger provider with DEBUG prefix.

func Error

func Error(v ...any)

Error calls the Println method of the logger provider with ERROR prefix.

func Info

func Info(v ...any)

Info calls the Println method of the logger provider with INFO prefix.

func Println

func Println(v ...any)

Println calls the Println method of the logger provider.

func SetLevel

func SetLevel(loglvl LogLevel)

SetLevel sets the logger level.

func SetProvider

func SetProvider(provider Provider)

SetProvider sets the logger provider.

func Warn

func Warn(v ...any)

Warn calls the Println method of the logger provider with WARN prefix.

Types

type LogLevel

type LogLevel int

LogLevel is the log level type.

const (
	// LevelDebug is the debug log level
	LevelDebug LogLevel = iota
	// LevelInfo is the info log level
	LevelInfo
	// LevelWarn is the warn log level
	LevelWarn
	// LevelError is the error log level
	LevelError
)

func (LogLevel) String

func (l LogLevel) String() string

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

Logger is the logger object

func New

func New(provider Provider, loglvl LogLevel) *Logger

New creates a new logger with the given provider.

type Provider

type Provider interface {
	Println(v ...any)
}

Provider is the interface that wraps the Println method.

Jump to

Keyboard shortcuts

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