logger

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DebugLevel int8 = iota - 1
	InfoLevel
	WarnLevel
	ErrorLevel
	PanicLevel
	FatalLevel
)

Variables

This section is empty.

Functions

func ConsoleEncoding

func ConsoleEncoding() *logger

ConsoleEncoding EncodeConsole sets the encoding `console` of logger. The default encoding is `json`.

func Debug

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

func Enable

func Enable() *logger

Enable makes logger enable to use.

func Error

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

func Fatal

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

func Info

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

func Level

func Level(level int8) *logger

Level sets the level of logger. The default level is `Info`.

func New

func New(name string) *logger

New returns a logger by specify a name

func Panic

func Panic(msg string, keyAndValues ...interface{})

func Warn

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

func WithConsole

func WithConsole() *logger

func WithFile

func WithFile(path string) *logger

WithFile sets the output file of logger.

func WithWriter

func WithWriter(w io.Writer) *logger

Types

This section is empty.

Jump to

Keyboard shortcuts

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