log

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2019 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close()

Close close the global logger

func Debug

func Debug(format string, a ...interface{}) (err error)

Debug log debug message.

func Debugx

func Debugx(logID, format string, a ...interface{}) (err error)

Debugx log debug message with logID.

func Fatal

func Fatal(format string, a ...interface{}) (err error)

Fatal log fatal message.

func Fatalx

func Fatalx(logID, format string, a ...interface{}) (err error)

Fatalx log fatal message with logID.

func Notice

func Notice(format string, a ...interface{}) (err error)

Notice log notice message.

func Noticex

func Noticex(logID, format string, a ...interface{}) (err error)

Noticex log notice message with logID.

func SetGlobalLogger

func SetGlobalLogger(lg Logger)

SetGlobalLogger set global logger, if global logger already exists, close it and set to new.

func Trace

func Trace(format string, a ...interface{}) (err error)

Trace log trace message.

func Tracex

func Tracex(logID, format string, a ...interface{}) (err error)

Tracex log trace message with logID.

func Warn

func Warn(format string, a ...interface{}) (err error)

Warn log warn message.

func Warnx

func Warnx(logID, format string, a ...interface{}) (err error)

Warnx log warn message with logID.

Types

type Logger

type Logger interface {
	SetLevel(name, level string) error

	Debug(format string, a ...interface{}) (err error)
	Trace(format string, a ...interface{}) (err error)
	Notice(format string, a ...interface{}) (err error)
	Warn(format string, a ...interface{}) (err error)
	Fatal(format string, a ...interface{}) (err error)

	Debugx(logID, format string, a ...interface{}) (err error)
	Tracex(logID, format string, a ...interface{}) (err error)
	Noticex(logID, format string, a ...interface{}) (err error)
	Warnx(logID, format string, a ...interface{}) (err error)
	Fatalx(logID, format string, a ...interface{}) (err error)

	Close()
}

Logger is the log interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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