log

package
v0.0.0-...-a4deb0f Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Log global

Functions

func Args

func Args(mess string, args ...interface{})

Args output message of print level

func Debug

func Debug(i ...interface{})

Debug output message of debug level

func Debugf

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

Debugf output format message of debug level

func Error

func Error(i ...interface{})

Error output message of error level

func Errorf

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

Errorf output format message of error level

func Fatal

func Fatal(i ...interface{})

Fatal output message of fatal level

func Fatalf

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

Fatalf output format message of fatal level

func Info

func Info(i ...interface{})

Info output message of info level

func Infof

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

Infof output format message of info level

func LoggerHandler

func LoggerHandler(next gin.HandlerFunc) gin.HandlerFunc

func Panic

func Panic(i ...interface{})

Panic output message of panic level

func Panicf

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

Panicf output format message of panic level

func Print

func Print(i ...interface{})

Print output message of print level

func Printf

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

Printf output format message of print level

func Warn

func Warn(i ...interface{})

Warn output message of warn level

func Warnf

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

Warnf output format message of warn level

Types

type MyLogger

type MyLogger struct {
	*logrus.Logger
}

MyLogger extend logrus.MyLogger

func InitLogger

func InitLogger(forTest bool) *MyLogger

InitLogger return singleton logger

func Logger

func Logger() *MyLogger

Logger returns singletonLogger NOTE: Must run InitLogger() before

func (*MyLogger) Debug

func (l *MyLogger) Debug(i ...interface{})

Debug output message of debug level

func (*MyLogger) Debugf

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

Debugf output format message of debug level

func (*MyLogger) Debugj

func (l *MyLogger) Debugj(j log.JSON)

Debugj output message of debug level

func (*MyLogger) Error

func (l *MyLogger) Error(i ...interface{})

Error output message of error level

func (*MyLogger) Errorf

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

Errorf output format message of error level

func (*MyLogger) Errorj

func (l *MyLogger) Errorj(j log.JSON)

Errorj output json of error level

func (*MyLogger) Fatal

func (l *MyLogger) Fatal(i ...interface{})

Fatal output message of fatal level

func (*MyLogger) Fatalf

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

Fatalf output format message of fatal level

func (*MyLogger) Fatalj

func (l *MyLogger) Fatalj(j log.JSON)

Fatalj output json of fatal level

func (*MyLogger) Formatter

func (l *MyLogger) Formatter() logrus.Formatter

Formatter return logger formatter

func (*MyLogger) Info

func (l *MyLogger) Info(i ...interface{})

Info output message of info level

func (*MyLogger) Infof

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

Infof output format message of info level

func (*MyLogger) Infoj

func (l *MyLogger) Infoj(j log.JSON)

Infoj output json of info level

func (*MyLogger) Level

func (l *MyLogger) Level() log.Lvl

Level return logger level

func (*MyLogger) Output

func (l *MyLogger) Output() io.Writer

Output return logger io.Writer

func (*MyLogger) Panic

func (l *MyLogger) Panic(i ...interface{})

Panic output message of panic level

func (*MyLogger) Panicf

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

Panicf output format message of panic level

func (*MyLogger) Panicj

func (l *MyLogger) Panicj(j log.JSON)

Panicj output json of panic level

func (*MyLogger) Prefix

func (l *MyLogger) Prefix() string

Prefix return logger prefix This function do nothing

func (*MyLogger) Print

func (l *MyLogger) Print(i ...interface{})

Print output message of print level

func (*MyLogger) Printf

func (l *MyLogger) Printf(format string, args ...interface{})

Printf output format message of print level

func (*MyLogger) Printj

func (l *MyLogger) Printj(j log.JSON)

Printj output json of print level

func (*MyLogger) SetFormatter

func (l *MyLogger) SetFormatter(formatter logrus.Formatter)

SetFormatter logger formatter Only support logrus formatter

func (*MyLogger) SetHeader

func (l *MyLogger) SetHeader(h string)

func (*MyLogger) SetLevel

func (l *MyLogger) SetLevel(v log.Lvl)

SetLevel logger level

func (*MyLogger) SetOutput

func (l *MyLogger) SetOutput(w io.Writer)

SetOutput logger io.Writer

func (*MyLogger) SetPrefix

func (l *MyLogger) SetPrefix(p string)

SetPrefix logger prefix This function do nothing

func (*MyLogger) Warn

func (l *MyLogger) Warn(i ...interface{})

Warn output message of warn level

func (*MyLogger) Warnf

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

Warnf output format message of warn level

func (*MyLogger) Warnj

func (l *MyLogger) Warnj(j log.JSON)

Warnj output json of warn level

Jump to

Keyboard shortcuts

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