logger

package
v0.0.0-...-78a0d84 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PANIC = iota
	FATAL
	ERROR
	WARN
	INFO
	DEBUG
	TRACE
)

Variables

This section is empty.

Functions

func Debug

func Debug(args interface{}, fields ...map[string]interface{})

func Debugf

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

func Error

func Error(args interface{}, fields ...map[string]interface{})

func Errorf

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

func Fatal

func Fatal(args interface{}, fields ...map[string]interface{})

func Fatalf

func Fatalf(format string, args ...interface{})

func GetLevel

func GetLevel(lvKey string) (lv int)

func GetLogPathFile

func GetLogPathFile(logConf *conf.LogConfig) string

func Info

func Info(args interface{}, fields ...map[string]interface{})

func Infof

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

func InitLog

func InitLog(level, maxAge, rotationTime int, pathFile string)

func Panic

func Panic(args interface{}, fields ...map[string]interface{})

func Panicf

func Panicf(format string, args ...interface{})

func SetLevel

func SetLevel(level int)

func Trace

func Trace(args interface{}, fields ...map[string]interface{})

func Tracef

func Tracef(format string, args ...interface{})

func Warn

func Warn(args interface{}, fields ...map[string]interface{})

func Warnf

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

Types

type Fields

type Fields = map[string]interface{}

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

func NewLogger

func NewLogger(lv int, isJsonFormat ...bool) *Logger

func NewLoggerByCfg

func NewLoggerByCfg(cfg *conf.LogConfig, isJsonFormat ...bool) *Logger

func (*Logger) Debug

func (l *Logger) Debug(args interface{}, fields ...map[string]interface{})

func (*Logger) Debugf

func (l *Logger) Debugf(format string, args ...interface{})

func (*Logger) Error

func (l *Logger) Error(args interface{}, fields ...map[string]interface{})

func (*Logger) Errorf

func (l *Logger) Errorf(format string, args ...interface{})

func (*Logger) Fatal

func (l *Logger) Fatal(args interface{}, fields ...map[string]interface{})

func (*Logger) Fatalf

func (l *Logger) Fatalf(format string, args ...interface{})

func (*Logger) Info

func (l *Logger) Info(args interface{}, fields ...map[string]interface{})

func (*Logger) Infof

func (l *Logger) Infof(format string, args ...interface{})

func (*Logger) Panic

func (l *Logger) Panic(args interface{}, fields ...map[string]interface{})

func (*Logger) Panicf

func (l *Logger) Panicf(format string, args ...interface{})

func (*Logger) SetLevel

func (l *Logger) SetLevel(level int)

func (*Logger) SetRotation

func (l *Logger) SetRotation(maxAge, rotationTime time.Duration, pathFile string)

func (*Logger) SetSkipNum

func (l *Logger) SetSkipNum(val int)

func (*Logger) Trace

func (l *Logger) Trace(args interface{}, fields ...map[string]interface{})

func (*Logger) Tracef

func (l *Logger) Tracef(format string, args ...interface{})

func (*Logger) Warn

func (l *Logger) Warn(args interface{}, fields ...map[string]interface{})

func (*Logger) Warnf

func (l *Logger) Warnf(format string, args ...interface{})

Jump to

Keyboard shortcuts

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