log

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2019 License: GPL-3.0 Imports: 4 Imported by: 31

Documentation

Index

Constants

View Source
const (
	// LDebug log level
	LDebug = 1
	// LInfo log level
	LInfo = 1 << 1
	// LError log level
	LError = 1 << 2
	// LCritical log level
	LCritical = 1 << 3
)

Variables

This section is empty.

Functions

func Critical

func Critical(i ...interface{})

Critical log message if gLogLevel <= LCritical

func Criticalf

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

Criticalf log message with format if gLogLevel <= LCritical

func Debug

func Debug(i ...interface{})

Debug log message if gLogLevel <= LDebug

func DebugDontPanic

func DebugDontPanic(i interface{})

DebugDontPanic only prints panic information but don't panic

func DebugDontPanicf

func DebugDontPanicf(format string, i ...interface{})

DebugDontPanicf only prints panic information but don't panic

func Debugf

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

Debugf log message with format if gLogLevel <= LDebug

func DontPanic

func DontPanic(i interface{})

DontPanic only prints panic information but don't panic

func DontPanicf

func DontPanicf(format string, i ...interface{})

DontPanicf only prints panic information but don't panic

func Error

func Error(i ...interface{})

Error log message if gLogLevel <= LError

func Errorf

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

Errorf log message with format if gLogLevel <= LError

func Info

func Info(i ...interface{})

Info log message if gLogLevel <= LInfo

func Infof

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

Infof log message with format if gLogLevel <= LInfo

func InitLogger

func InitLogger(logLevel int)

InitLogger Initialize the global logger

func LogError

func LogError(err error)

LogError logs an error

func LogErrorAndExit

func LogErrorAndExit(err error, opts ...int)

LogErrorAndExit logs an error and exit with an optional return code

func Panic

func Panic(i interface{})

Panic prints panic information and call panic

func RestoreLogLevel

func RestoreLogLevel()

RestoreLogLevel restore gLogLevel to gLogLevelBackup

func SetLogLevel

func SetLogLevel(logLevel int)

SetLogLevel backup gLoglevel and set gLogLevel to logLevel

func SetLogfile

func SetLogfile(logfilePath string, opts ...os.FileMode)

SetLogfile sets output file to put logging messages

func Warn

func Warn(i ...interface{})

Warning log message if gLogLevel <= LInfo

func Warnf

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

Warnf log message with format if gLogLevel <= LInfo

Types

This section is empty.

Jump to

Keyboard shortcuts

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