logger

package
v0.46.0 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2022 License: GPL-3.0 Imports: 9 Imported by: 16

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GlobalMsgCountWatcher = newMsgCountWatcher(resetEvery)

GlobalMsgCountWatcher is an initiated instance of MsgCountWatcher. It resets message counter for every registered logger every 1 seconds.

View Source
var (
	Prefix = "goplugin"
)

Functions

func Critical

func Critical(a ...interface{})

Critical logs a message with the Critical severity

func Criticalf

func Criticalf(format string, a ...interface{})

Criticalf logs a message with the Critical severity using the same syntax and options as fmt.Printf

func Criticalln added in v0.23.0

func Criticalln(a ...interface{})

Criticalln logs a message with the Critical severity

func Debug

func Debug(a ...interface{})

Debug logs a message with the Debug severity

func Debugf

func Debugf(format string, a ...interface{})

Debugf logs a message with the Debug severity using the same syntax and options as fmt.Printf

func Debugln added in v0.23.0

func Debugln(a ...interface{})

Debugln logs a message with the Debug severity

func Error

func Error(a ...interface{})

Error logs a message with the Error severity

func Errorf

func Errorf(format string, a ...interface{})

Errorf logs a message with the Error severity using the same syntax and options as fmt.Printf

func Errorln added in v0.23.0

func Errorln(a ...interface{})

Errorln logs a message with the Error severity

func Info

func Info(a ...interface{})

Info logs a message with the Info severity

func Infof

func Infof(format string, a ...interface{})

Infof logs a message with the Info severity using the same syntax and options as fmt.Printf

func Infoln added in v0.23.0

func Infoln(a ...interface{})

Infoln logs a message with the Info severity

func IsDebug added in v0.28.1

func IsDebug() bool

func Panic

func Panic(a ...interface{})

Panic logs a message with the Critical severity then panic

func Panicf

func Panicf(format string, a ...interface{})

Panicf logs a message with the Critical severity using the same syntax and options as fmt.Printf then panic

func Panicln added in v0.23.0

func Panicln(a ...interface{})

Panicln logs a message with the Critical severity then panic

func SetSeverity

func SetSeverity(severity Severity)

SetSeverity sets global severity level

func Warning

func Warning(a ...interface{})

Warning logs a message with the Warning severity

func Warningf

func Warningf(format string, a ...interface{})

Warningf logs a message with the Warning severity using the same syntax and options as fmt.Printf

func Warningln added in v0.23.0

func Warningln(a ...interface{})

Warningln logs a message with the Warning severity

Types

type Logger

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

Logger represents a logger object

func New

func New(modName, jobName string) *Logger

New creates a new logger.

func NewLimited

func NewLimited(modName, jobName string) *Logger

NewLimited creates a new limited logger

func (*Logger) Critical

func (l *Logger) Critical(a ...interface{})

Critical logs a message with the Critical severity

func (*Logger) Criticalf

func (l *Logger) Criticalf(format string, a ...interface{})

Criticalf logs a message with the Critical severity using the same syntax and options as fmt.Printf

func (*Logger) Criticalln added in v0.23.0

func (l *Logger) Criticalln(a ...interface{})

Criticalln logs a message with the Critical severity

func (*Logger) Debug

func (l *Logger) Debug(a ...interface{})

Debug logs a message with the Debug severity

func (*Logger) Debugf

func (l *Logger) Debugf(format string, a ...interface{})

Debugf logs a message with the Debug severity using the same syntax and options as fmt.Printf

func (*Logger) Debugln added in v0.23.0

func (l *Logger) Debugln(a ...interface{})

Debugln logs a message with the Debug severity

func (*Logger) Error

func (l *Logger) Error(a ...interface{})

Error logs a message with the Error severity

func (*Logger) Errorf

func (l *Logger) Errorf(format string, a ...interface{})

Errorf logs a message with the Error severity using the same syntax and options as fmt.Printf

func (*Logger) Errorln added in v0.23.0

func (l *Logger) Errorln(a ...interface{})

Errorln logs a message with the Error severity

func (*Logger) Info

func (l *Logger) Info(a ...interface{})

Info logs a message with the Info severity

func (*Logger) Infof

func (l *Logger) Infof(format string, a ...interface{})

Infof logs a message with the Info severity using the same syntax and options as fmt.Printf

func (*Logger) Infoln added in v0.23.0

func (l *Logger) Infoln(a ...interface{})

Infoln logs a message with the Info severity

func (*Logger) Panic

func (l *Logger) Panic(a ...interface{})

Panic logs a message with the Critical severity then panic

func (*Logger) Panicf

func (l *Logger) Panicf(format string, a ...interface{})

Panicf logs a message with the Critical severity using the same syntax and options as fmt.Printf then panic

func (*Logger) Panicln added in v0.23.0

func (l *Logger) Panicln(a ...interface{})

Panicln logs a message with the Critical severity then panic

func (*Logger) Print added in v0.23.0

func (l *Logger) Print(a ...interface{})

Print logs a message with the Info severity (same as Info)

func (*Logger) Printf added in v0.23.0

func (l *Logger) Printf(format string, a ...interface{})

Printf logs a message with the Info severity using the same syntax and options as fmt.Printf

func (*Logger) Println added in v0.23.0

func (l *Logger) Println(a ...interface{})

Println logs a message with the Info severity (same as Infoln)

func (*Logger) Warning

func (l *Logger) Warning(a ...interface{})

Warning logs a message with the Warning severity

func (*Logger) Warningf

func (l *Logger) Warningf(format string, a ...interface{})

Warningf logs a message with the Warning severity using the same syntax and options as fmt.Printf

func (*Logger) Warningln added in v0.23.0

func (l *Logger) Warningln(a ...interface{})

Warningln logs a message with the Warning severity

type MsgCountWatcher

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

MsgCountWatcher MsgCountWatcher

func (*MsgCountWatcher) Register

func (m *MsgCountWatcher) Register(logger *Logger)

Register adds logger to the collection.

func (*MsgCountWatcher) Unregister

func (m *MsgCountWatcher) Unregister(logger *Logger)

Unregister removes logger from the collection.

type Severity

type Severity int

Severity is a logging severity level

const (
	// CRITICAL severity level
	CRITICAL Severity = iota
	// ERROR severity level
	ERROR
	// WARNING severity level
	WARNING
	// INFO severity level
	INFO
	// DEBUG severity level
	DEBUG
)

func (Severity) ShortString

func (s Severity) ShortString() string

ShortString returns human-readable short string

func (Severity) String

func (s Severity) String() string

String returns human-readable string

Jump to

Keyboard shortcuts

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