logger

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2022 License: BSD-3-Clause Imports: 10 Imported by: 8

Documentation

Index

Constants

View Source
const (
	// StdErr is the default configuration for log output.
	StdErr = "stderr"
	// StdOut configuration for log output
	StdOut = "stdout"
)

Variables

This section is empty.

Functions

func Debugf

func Debugf(fmt string, args ...interface{})

Debugf log to level debug

func Errorf

func Errorf(fmt string, args ...interface{})

Errorf log to level error

func FatalIfError

func FatalIfError(err error)

FatalIfError if err is not nil, then log to level fatal and call os.Exit

func FatalfIf

func FatalfIf(cond bool, fmt string, args ...interface{})

FatalfIf log to level error

func Infof

func Infof(fmt string, args ...interface{})

Infof log to level info

func InitLog

func InitLog(level string)

InitLog is an initialization for a logger level can be: debug info warn error

func InitLog2 added in v1.10.2

func InitLog2(level string, outputs string, logRotationEnable int64, logRotateConfigJSON string)

InitLog2 specify advanced log config

func Warnf

func Warnf(fmt string, args ...interface{})

Warnf log to level warn

func WithLogger added in v1.9.0

func WithLogger(log Logger)

WithLogger replaces default logger

Types

type Logger added in v1.9.0

type Logger interface {
	Debugf(format string, args ...interface{})
	Infof(format string, args ...interface{})
	Warnf(format string, args ...interface{})
	Errorf(format string, args ...interface{})
}

Logger logger interface

Jump to

Keyboard shortcuts

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