log

package
v1.1.41 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2022 License: GPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DebugLog = 1 << iota
	TraceLog
	InfoLog
	WarnLog
	ErrorLog
	PanicLog
	FatalLog
)
View Source
const DefaultLogPath = "./runtime/logs/app.log"

Variables

View Source
var LogLevelMap = map[int]string{
	TraceLog: "Trace",
	DebugLog: "Debug",
	InfoLog:  "Info",
	WarnLog:  "Warning",
	ErrorLog: "Error",
	FatalLog: "Fatal",
	PanicLog: "Panic",
}

Functions

This section is empty.

Types

type DefaultZapLog

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

default logger

func NewZapLog

func NewZapLog(name string, logPath string, c *config.LogConfig) *DefaultZapLog

func (*DefaultZapLog) Caller added in v1.1.39

func (l *DefaultZapLog) Caller(offset int) *DefaultZapLog

func (*DefaultZapLog) Debug

func (l *DefaultZapLog) Debug(format string, params ...interface{})

func (*DefaultZapLog) Error

func (l *DefaultZapLog) Error(format string, params ...interface{})

func (*DefaultZapLog) Fatal

func (l *DefaultZapLog) Fatal(format string, params ...interface{})

func (*DefaultZapLog) Info

func (l *DefaultZapLog) Info(format string, params ...interface{})

func (*DefaultZapLog) Panic

func (l *DefaultZapLog) Panic(format string, params ...interface{})

func (*DefaultZapLog) Warn

func (l *DefaultZapLog) Warn(format string, params ...interface{})

type ILog

type ILog interface {
	Debug(log string, params ...interface{})
	Info(log string, params ...interface{})
	Warn(log string, params ...interface{})
	Error(log string, params ...interface{})
	Panic(log string, params ...interface{})
	Fatal(log string, params ...interface{})
}

func NewDefaultLogger

func NewDefaultLogger(name string, c *config.LogConfig) ILog

type InvokeLog

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

fast use log

func (*InvokeLog) AddLogger

func (ink *InvokeLog) AddLogger(logger ILog)

func (*InvokeLog) Debug

func (ink *InvokeLog) Debug(log string, params ...interface{})

func (*InvokeLog) Error

func (ink *InvokeLog) Error(log string, params ...interface{})

func (*InvokeLog) Fatal

func (ink *InvokeLog) Fatal(log string, params ...interface{})

func (*InvokeLog) Info

func (ink *InvokeLog) Info(log string, params ...interface{})

func (*InvokeLog) Log

func (ink *InvokeLog) Log(level int8, msg string)

func (*InvokeLog) Panic

func (ink *InvokeLog) Panic(log string, params ...interface{})

func (*InvokeLog) Warn

func (ink *InvokeLog) Warn(log string, params ...interface{})

type MyLogger

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

日志

func (*MyLogger) Debug

func (logger *MyLogger) Debug(format string, params ...interface{})

func (*MyLogger) Error

func (logger *MyLogger) Error(format string, params ...interface{})

func (*MyLogger) Fatal

func (logger *MyLogger) Fatal(format string, params ...interface{})

func (*MyLogger) Info

func (logger *MyLogger) Info(format string, params ...interface{})

func (*MyLogger) LogPath

func (logger *MyLogger) LogPath() string

最终日志path

func (*MyLogger) Panic

func (logger *MyLogger) Panic(format string, params ...interface{})

func (*MyLogger) Path

func (logger *MyLogger) Path() string

设置的path

func (*MyLogger) Warn

func (logger *MyLogger) Warn(format string, params ...interface{})

func (*MyLogger) Write

func (logger *MyLogger) Write(p []byte) (int, error)

type ZapLogConfig

type ZapLogConfig struct {
	SyncStdOut bool //是否同步输出至标准输出
	MaxSize    int  // 每个日志文件保存的大小 单位:M
	MaxAge     int  // 文件最多保存多少天
	MaxBackups int  // 日志文件最多保存多少个备份
	Compress   bool // 是否压缩

	LogLevel string //日志级别
}

日志配置,已经废弃,请使用config.LogConfig

Jump to

Keyboard shortcuts

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