log4go

package
v1.0.45 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BindHooks added in v1.0.41

func BindHooks(hook logrus.Hook)

func D

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

func Dir

func Dir() string

Dir log dir

func E

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

func F

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

func I

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

func InitLog

func InitLog(writePath, filename string, _maxAge uint32, _rotationTime int64, _rotationSize int64, _rotationCount uint32)

func Logf

func Logf(logName string, logLevel LOGLEVEL, format string, args ...interface{})

Logf 格式化输出

func Logln

func Logln(logName string, logLevel LOGLEVEL, args ...interface{})

Logln 换行输出

func SetLogLevel

func SetLogLevel(logLevel logrus.Level)

InfoLevel=4, DebugLevel=5, logrus.TraceLevel=6

func T

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

func W

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

Types

type LOGLEVEL

type LOGLEVEL int

LOGLEVEL 日志级别

const (
	TraceLevel LOGLEVEL
	DebugLevel
	InfoLevel
	WarnLevel
	ErrorLevel
	PanicLevel
	FatalLevel
)

type Logger

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

Logger logger

type LoggerMgr

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

LoggerMgr log管理器

func GetInstance

func GetInstance() *LoggerMgr

GetInstance 用于获取单例模式对象

func (*LoggerMgr) GetLogger

func (mgr *LoggerMgr) GetLogger(logName string) *Logger

GetLogger 获得一个logger

func (*LoggerMgr) InitLogger

func (mgr *LoggerMgr) InitLogger(logName string) *Logger

InitLogger 初始化访问日志

Jump to

Keyboard shortcuts

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