log

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// LevelTrace is the log level for tracing.
	LevelTrace = iota
	// LevelDebug is the log level for debugging.
	LevelDebug
	// LevelInfo is the log level for informational messages.
	LevelInfo
	// LevelWarn is the log level for warnings.
	LevelWarn
	// LevelError is the log level for errors.
	LevelError
	// LevelFatal is the log level for fatal errors.
	LevelFatal
	// LevelPanic is the log level for panics.
	LevelPanic
)

Variables

This section is empty.

Functions

func Debug

func Debug(message string)

Debug logs a message at the debug level.

func DebugWithFields

func DebugWithFields(message string, fields FieldsMap)

DebugWithFields logs a message at the debug level with additional fields.

func Debugf

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

Debugf logs a formatted message at the debug level.

func DebugfWithFields

func DebugfWithFields(format string, fields FieldsMap, args ...interface{})

DebugfWithFields logs a formatted message at the debug level with additional fields.

func Error

func Error(message string)

Error logs a message at the error level.

func ErrorWithFields

func ErrorWithFields(message string, fields FieldsMap)

ErrorWithFields logs a message at the error level with additional fields.

func Errorf

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

Errorf logs a formatted message at the error level.

func ErrorfWithFields

func ErrorfWithFields(format string, fields FieldsMap, args ...interface{})

ErrorfWithFields logs a formatted message at the error level with additional fields.

func Fatal

func Fatal(message string)

Fatal logs a message at the fatal level.

func FatalWithFields

func FatalWithFields(message string, fields FieldsMap)

FatalWithFields logs a message at the fatal level with additional fields.

func Fatalf

func Fatalf(format string, args ...interface{})

Fatalf logs a formatted message at the fatal level.

func FatalfWithFields

func FatalfWithFields(format string, fields FieldsMap, args ...interface{})

FatalfWithFields logs a formatted message at the fatal level with additional fields.

func Info

func Info(message string)

Info logs a message at the info level.

func InfoWithFields

func InfoWithFields(message string, fields FieldsMap)

InfoWithFields logs a message at the info level with additional fields.

func Infof

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

Infof logs a formatted message at the info level.

func InfofWithFields

func InfofWithFields(format string, fields FieldsMap, args ...interface{})

InfofWithFields logs a formatted message at the info level with additional fields.

func Panic

func Panic(message string)

Panic logs a message at the panic level.

func PanicWithFields

func PanicWithFields(message string, fields FieldsMap)

PanicWithFields logs a message at the panic level with additional fields.

func Panicf

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

Panicf logs a formatted message at the panic level.

func PanicfWithFields

func PanicfWithFields(format string, fields FieldsMap, args ...interface{})

PanicfWithFields logs a formatted message at the panic level with additional fields.

func SetLevel

func SetLevel(newLevel Level)

SetLevel sets the log level for the logger.

func SetOutput

func SetOutput(writer io.Writer)

SetOutput sets the output writer for the logger.

func Trace

func Trace(message string)

Trace logs a message at the trace level.

func TraceWithFields

func TraceWithFields(message string, fields FieldsMap)

TraceWithFields logs a message at the trace level with additional fields.

func Tracef

func Tracef(format string, args ...interface{})

Tracef logs a formatted message at the trace level.

func TracefWithFields

func TracefWithFields(format string, fields FieldsMap, args ...interface{})

TracefWithFields logs a formatted message at the trace level with additional fields.

func Warn

func Warn(message string)

Warn logs a message at the warn level.

func WarnWithFields

func WarnWithFields(message string, fields FieldsMap)

WarnWithFields logs a message at the warn level with additional fields.

func Warnf

func Warnf(format string, args ...interface{})

Warnf logs a formatted message at the warn level.

func WarnfWithFields

func WarnfWithFields(format string, fields FieldsMap, args ...interface{})

WarnfWithFields logs a formatted message at the warn level with additional fields.

Types

type FieldsMap

type FieldsMap map[string]interface{}

FieldsMap is the type of the map that is passed to the log functions.

type Level

type Level uint32

Level is the type of the log level.

func ParseLevel

func ParseLevel(level string) (Level, error)

ParseLevel parses the given string and returns the corresponding log level.

Jump to

Keyboard shortcuts

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