logger

package module
v0.0.0-...-aa31d01 Latest Latest
Warning

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

Go to latest
Published: May 29, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// LogLevelCritical is the critical log level
	LogLevelCritical = "CRITICAL"
	// LogLevelError is the error log level
	LogLevelError = "ERROR"
	// LogLevelWarn is the warn log level
	LogLevelWarn = "WARN"
	// LogLevelDebug is the debug log level
	LogLevelDebug = "DEBUG"
	// LogLevelInfo is the info log level
	LogLevelInfo = "INFO"
	// LogLevelTrace is the trace log level
	LogLevelTrace = "TRACE"
)

Variables

This section is empty.

Functions

func Critical

func Critical(a ...interface{})

Critical prints a message if log level is set to CRITICAL or lower.

func Criticalf

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

Criticalf prints a message if log level is set to CRITICAL or lower, with formatting.

func Debug

func Debug(a ...interface{})

Debug prints a message if log level is set to DEBUG or lower.

func Debugf

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

Debugf prints a message if log level is set to DEBUG or lower, with formatting.

func Error

func Error(a ...interface{})

Error prints a message if log level is set to ERROR or lower.

func Errorf

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

Errorf prints a message if log level is set to ERROR or lower, with formatting.

func Info

func Info(a ...interface{})

Info prints a message if log level is set to INFO or lower.

func Infof

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

Infof prints a message if log level is set to INFO or lower, with formatting.

func SetLogLevel

func SetLogLevel(level LogLevel)

SetLogLevel sets the loglevel of the logger

func SetLogOutputFile

func SetLogOutputFile(logFileName string)

SetLogOutputFile sets the logger's output file

func SetOutput

func SetOutput(writer io.Writer)

SetOutput prints a message if log level is set to CRITICAL or lower, with formatting.

func SetShowCallerInfo

func SetShowCallerInfo(isEnable bool)

SetShowCallerInfo sets if the logger should log the caller info

func Trace

func Trace(tracelevel int, a ...interface{})

Trace prints a message if log level is set to TRACE or lower.

func Tracef

func Tracef(tracelevel int, format string, a ...interface{})

Tracef prints a message if log level is set to TRACE or lower, with formatting.

func Warn

func Warn(a ...interface{})

Warn prints a message if log level is set to WARN or lower, with formatting.

func Warnf

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

Warnf prints a message if log level is set to WARN or lower, with formatting.

Types

type LogLevel

type LogLevel string

LogLevel defines the loglevel

Jump to

Keyboard shortcuts

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