log

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Level is the current log level
	Level = INFO
)

Functions

func Debug

func Debug(msg string, args ...interface{})

Debug logs a message at debug level

func Error

func Error(msg string, args ...interface{})

Error logs a message at error level

func Fatal

func Fatal(msg string, args ...interface{})

Fatal logs a message at fatal level and exits

func Info

func Info(msg string, args ...interface{})

Info logs a message at info level

func Trace

func Trace(msg string, args ...interface{})

Trace logs a message at trace level

func Warn

func Warn(msg string, args ...interface{})

Warn logs a message at warn level

Types

type LogLevel

type LogLevel int

LogLevel represents a log level

const (
	// TRACE trace
	TRACE LogLevel = iota
	// DEBUG debug
	DEBUG
	// INFO info
	INFO
	// WARN warn
	WARN
	// ERROR error
	ERROR
	// FATAL fatal
	FATAL
)

func LevelFromString

func LevelFromString(level string) LogLevel

LevelFromString takes a string and returns the corresponding log level

func (LogLevel) String

func (l LogLevel) String() string

String returns log level as a string

Jump to

Keyboard shortcuts

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