log

package
v1.1.11 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2021 License: GPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DebugLog = 1 << iota
	TraceLog
	InfoLog
	WarnLog
	ErrorLog
	PanicLog
	FatalLog
)
View Source
const DefaultLogPath = "./runtime/logs/daily.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 (*DefaultZapLog) Debug

func (l *DefaultZapLog) Debug(msg string) error

func (*DefaultZapLog) Debugf

func (l *DefaultZapLog) Debugf(format string, s ...interface{}) error

func (*DefaultZapLog) Error

func (l *DefaultZapLog) Error(msg string) error

func (*DefaultZapLog) Errorf

func (l *DefaultZapLog) Errorf(format string, s ...interface{}) error

func (*DefaultZapLog) Fatal

func (l *DefaultZapLog) Fatal(msg string) error

func (*DefaultZapLog) Fatalf

func (l *DefaultZapLog) Fatalf(format string, s ...interface{}) error

func (*DefaultZapLog) Info

func (l *DefaultZapLog) Info(msg string) error

func (*DefaultZapLog) Infof

func (l *DefaultZapLog) Infof(format string, s ...interface{}) error

func (*DefaultZapLog) Panic

func (l *DefaultZapLog) Panic(msg string) error

func (*DefaultZapLog) Panicf

func (l *DefaultZapLog) Panicf(format string, s ...interface{}) error

func (*DefaultZapLog) Warn

func (l *DefaultZapLog) Warn(msg string) error

func (*DefaultZapLog) Warnf

func (l *DefaultZapLog) Warnf(format string, s ...interface{}) error

type ILog

type ILog interface {
	Debug(log string) error
	Info(log string) error
	Warn(log string) error
	Error(log string) error
	Panic(log string) error
	Fatal(log string) error

	Debugf(log string, params ...interface{}) error
	Infof(log string, params ...interface{}) error
	Warnf(log string, params ...interface{}) error
	Errorf(log string, params ...interface{}) error
	Panicf(log string, params ...interface{}) error
	Fatalf(log string, params ...interface{}) error
}

func NewZapLog

func NewZapLog(name string, logPath string, config *ZapLogConfig) 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{}) error

func (*InvokeLog) Error

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

func (*InvokeLog) Fatal

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

func (*InvokeLog) Info

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

func (*InvokeLog) Log

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

func (*InvokeLog) Panic

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

func (*InvokeLog) Warn

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

type MyLogger

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

func NewDefaultLogger

func NewDefaultLogger(c *MyLoggerConfig) *MyLogger

func (*MyLogger) Debug

func (logger *MyLogger) Debug(s string) error

func (*MyLogger) Debugf

func (logger *MyLogger) Debugf(format string, s ...interface{}) error

func (*MyLogger) Error

func (logger *MyLogger) Error(s string) error

func (*MyLogger) Errorf

func (logger *MyLogger) Errorf(format string, s ...interface{}) error

func (*MyLogger) Fatal

func (logger *MyLogger) Fatal(s string) error

func (*MyLogger) Fatalf

func (logger *MyLogger) Fatalf(format string, s ...interface{}) error

func (*MyLogger) Info

func (logger *MyLogger) Info(s string) error

func (*MyLogger) Infof

func (logger *MyLogger) Infof(format string, s ...interface{}) error

func (*MyLogger) LogPath

func (logger *MyLogger) LogPath() string

最终日志path

func (*MyLogger) Panic

func (logger *MyLogger) Panic(s string) error

func (*MyLogger) Panicf

func (logger *MyLogger) Panicf(format string, s ...interface{}) error

func (*MyLogger) Path

func (logger *MyLogger) Path() string

设置的path

func (*MyLogger) Trace

func (logger *MyLogger) Trace(s string) error

func (*MyLogger) Warn

func (logger *MyLogger) Warn(s string) error

func (*MyLogger) Warnf

func (logger *MyLogger) Warnf(format string, s ...interface{}) error

func (*MyLogger) Write

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

type MyLoggerConfig

type MyLoggerConfig struct {
	Module         string
	Path           string
	PathAutoCreate bool
	ConsoleOut     bool
	Flag           int
}

func (*MyLoggerConfig) LogPath

func (c *MyLoggerConfig) LogPath() string

type ZapLogConfig

type ZapLogConfig struct {
	MaxSize    int
	MaxAge     int
	MaxBackups int
	Compress   bool

	DebugLevel string
}

Jump to

Keyboard shortcuts

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