logger

package
v0.0.0-...-4903ad3 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2021 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	None     Level = iota
	Debug          = iota + 10
	Info           = iota + 10
	Warning        = iota + 10
	Error          = iota + 10
	Critical       = iota + 10
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Level

type Level int

func (Level) ToString

func (level Level) ToString() string

type Log

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

Log represents the logging object

func (*Log) GetLevel

func (l *Log) GetLevel() Level

GetLevel returns the log level

func (*Log) Log

func (l *Log) Log(level Level, v ...interface{}) error

Log calls Output to print to the logger

func (*Log) Logd

func (l *Log) Logd(level Level, delta int, v ...interface{}) error

Logd calls Output with variable depth to print to the logger

func (*Log) Logdf

func (l *Log) Logdf(level Level, delta int, format string, v ...interface{}) error

Logfd calls Output with variable depth to print to the logger

func (*Log) Logf

func (l *Log) Logf(level Level, format string, v ...interface{}) error

Logf calls Output to print to the logger

func (*Log) Output

func (l *Log) Output(level Level, depth int, s string) error

Output writes the output for a logging event

type Logger

type Logger interface {
	GetLevel() Level
	Output(level Level, depth int, s string) error
	Log(level Level, v ...interface{}) error
	Logf(level Level, format string, v ...interface{}) error
	Logd(level Level, delta int, v ...interface{}) error
	Logdf(level Level, delta int, format string, v ...interface{}) error
}

Logger implements a logging mechanism

func GetLogger

func GetLogger() Logger

GetLogger returns the current logger

func NewLogger

func NewLogger(owner string, level Level) Logger

NewLogger creates a new logger

Jump to

Keyboard shortcuts

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