logger

package
v0.1.0-M4 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2023 License: Apache-2.0, EPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(v interface{})

Debug writes an debug entry to the log.

func Debugf

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

Debugf formats according to a format specifier and write the string as an debug entry to the log.

func Error

func Error(v interface{})

Error writes an error entry to the log.

func Errorf

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

Errorf formats according to a format specifier and write the string as an error entry to the log.

func Info

func Info(v interface{})

Info writes an info entry to the log.

func Infof

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

Infof formats according to a format specifier and write the string as an info entry to the log.

func IsDebugEnabled

func IsDebugEnabled() bool

IsDebugEnabled checks if debug log level is enabled.

func IsTraceEnabled

func IsTraceEnabled() bool

IsTraceEnabled checks if trace log level is enabled.

func SetupLogger

func SetupLogger(logConfig *LogConfig) io.WriteCloser

SetupLogger initialized the log besed on the provided log configuration.

func Trace

func Trace(v ...interface{})

Trace writes an trace entry to the log.

func Tracef

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

Tracef formats according to a format specifier and write the string as an trace entry to the log.

func Warn

func Warn(v interface{})

Warn writes a warning entry to the log.

func Warnf

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

Warnf formats according to a format specifier and write the string as a warning entry to the log.

Types

type LogConfig

type LogConfig struct {
	LogFile       string
	LogLevel      string
	LogFileSize   int
	LogFileCount  int
	LogFileMaxAge int
}

LogConfig represents a log configuration.

type LogLevel

type LogLevel int

LogLevel represents a log level.

const (
	// ERROR represents the error log level.
	ERROR LogLevel = 1 + iota
	// WARN represents the warn log level.
	WARN
	// INFO represents the info log level.
	INFO
	// DEBUG represents the debug log level.
	DEBUG
	// TRACE represents the trace log level.
	TRACE
)

Jump to

Keyboard shortcuts

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