log

package
v5.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NOTSET = iota - 1
	EMERGENCY
	ALERT
	CRITICAL
	ERROR
	WARNING
	NOTICE
	INFO
	DEBUG
)

These flags define the error levels following RFC5425. See https://tools.ietf.org/html/rfc5424/.

Variables

This section is empty.

Functions

func Alert

func Alert(v ...interface{})

Alert logs an alert message.

func Alertf

func Alertf(format string, v ...interface{})

Alertf logs a alert message with format.

func Critical

func Critical(v ...interface{})

Critical logs a critical message.

func Criticalf

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

Criticalf logs a critical message with format.

func Debug

func Debug(v ...interface{})

Debug logs a debug message.

func Debugf

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

Debugf logs a debug message with format.

func Disable

func Disable()

Disable logging.

func Emergency

func Emergency(v ...interface{})

Emergency logs an emergency message.

func Emergencyf

func Emergencyf(format string, v ...interface{})

Emergencyf logs a emergency message with format.

func Enable

func Enable()

Enable logging.

func Error

func Error(v ...interface{})

Error logs an error message.

func Errorf

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

Errorf logs an error message with format.

func GetLevel

func GetLevel() int

GetLevel returns the current log level.

func Info

func Info(v ...interface{})

Info logs an info message.

func Infof

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

Infof logs an info message with format.

func Log

func Log(level int, v ...interface{})

Log writes a log message.

func Logf

func Logf(level int, format string, v ...interface{})

Logf writes a log message for a level with format.

func Notice

func Notice(v ...interface{})

Notice logs a notice message.

func Noticef

func Noticef(format string, v ...interface{})

Noticef logs a notice message with format.

func SetLevel

func SetLevel(level int)

SetLevel changes the current log level.

func SetOutput

func SetOutput(w io.Writer)

SetOutput changes the logging output.

func ValueToLogString

func ValueToLogString(value interface{}) (result string, err error)

ValueToLogString returns a string representation of a value.

func Warning

func Warning(v ...interface{})

Warning logs a warning message.

func Warningf

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

Warningf logs a warning message with format.

Types

type RequestLogger

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

RequestLogger is a logger with request ID support. The request ID is added to every log message written using this logger.

func NewRequestLogger

func NewRequestLogger(rid string) RequestLogger

NewRequestLogger creates a new logger wuth request ID support.

func (RequestLogger) Alert

func (r RequestLogger) Alert(v ...interface{})

Alert logs an alert message.

func (RequestLogger) Alertf

func (r RequestLogger) Alertf(format string, v ...interface{})

Alertf logs a alert message with format.

func (RequestLogger) Critical

func (r RequestLogger) Critical(v ...interface{})

Critical logs a critical message.

func (RequestLogger) Criticalf

func (r RequestLogger) Criticalf(format string, v ...interface{})

Criticalf logs a critical message with format.

func (RequestLogger) Debug

func (r RequestLogger) Debug(v ...interface{})

Debug logs a debug message.

func (RequestLogger) Debugf

func (r RequestLogger) Debugf(format string, v ...interface{})

Debugf logs a debug message with format.

func (RequestLogger) Emergency

func (r RequestLogger) Emergency(v ...interface{})

Emergency logs an emergency message.

func (RequestLogger) Emergencyf

func (r RequestLogger) Emergencyf(format string, v ...interface{})

Emergencyf logs a emergency message with format.

func (RequestLogger) Error

func (r RequestLogger) Error(v ...interface{})

Error logs an error message.

func (RequestLogger) Errorf

func (r RequestLogger) Errorf(format string, v ...interface{})

Errorf logs an error message with format.

func (RequestLogger) Info

func (r RequestLogger) Info(v ...interface{})

Info logs an info message.

func (RequestLogger) Infof

func (r RequestLogger) Infof(format string, v ...interface{})

Infof logs an info message with format.

func (RequestLogger) Log

func (r RequestLogger) Log(level int, v ...interface{})

Log a message.

func (RequestLogger) Notice

func (r RequestLogger) Notice(v ...interface{})

Notice logs a notice message.

func (RequestLogger) Noticef

func (r RequestLogger) Noticef(format string, v ...interface{})

Noticef logs a notice message with format.

func (RequestLogger) RID

func (r RequestLogger) RID() string

RID returns the request ID.

func (RequestLogger) Warning

func (r RequestLogger) Warning(v ...interface{})

Warning logs a warning message.

func (RequestLogger) Warningf

func (r RequestLogger) Warningf(format string, v ...interface{})

Warningf logs a warning message with format.

Jump to

Keyboard shortcuts

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