log

package
v0.0.0-...-9b3b26b Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeInfo  = "INFO"
	TypeWarn  = "WARN"
	TypeError = "ERROR"
	TypeFatal = "FATAL"
	TypeDebug = "DEBUG"
)
View Source
const (
	MonthlyRotate = "Monthly"
	DailyRotate   = "Daily"
	HourlyRotate  = "Hourly"
)
View Source
const DefaultRotate = DailyRotate

Variables

This section is empty.

Functions

func Access

func Access(remoteAddr string, usedTime int64, request []byte, err error)

func CheckRotation

func CheckRotation(rotation string) bool

func CloseLog

func CloseLog()

func Debug

func Debug(arg ...interface{})

func Debugf

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

func Error

func Error(arg ...interface{})

func Errorf

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

func Fatal

func Fatal(arg ...interface{})

func Fatalf

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

func FileLine

func FileLine(caller interface{}, length int) string

func Info

func Info(arg ...interface{})

func Infof

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

func IsDebug

func IsDebug() bool

func Slow

func Slow(remoteAddr string, usedTimeUs int64, request []byte, err error)

func Stats

func Stats(arg interface{})

func Warn

func Warn(arg ...interface{})

func Warnf

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

Types

type LevelEnable

type LevelEnable struct{}

func (*LevelEnable) Enabled

func (le *LevelEnable) Enabled(l zapcore.Level) bool

type Logger

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

func GetLogger

func GetLogger() *Logger

func NewLogger

func NewLogger(opts *Options) *Logger

func (*Logger) Access

func (l *Logger) Access(remoteAddr string, cost int64, request []byte, err error)

func (*Logger) CloseSync

func (l *Logger) CloseSync()

func (*Logger) Debug

func (l *Logger) Debug(arg ...interface{})

func (*Logger) Debugf

func (l *Logger) Debugf(ft string, arg ...interface{})

func (*Logger) Error

func (l *Logger) Error(arg ...interface{})

func (*Logger) Errorf

func (l *Logger) Errorf(ft string, arg ...interface{})

func (*Logger) Fatal

func (l *Logger) Fatal(arg ...interface{})

func (*Logger) Fatalf

func (l *Logger) Fatalf(ft string, arg ...interface{})

func (*Logger) Info

func (l *Logger) Info(arg ...interface{})

func (*Logger) Infof

func (l *Logger) Infof(ft string, arg ...interface{})

func (*Logger) Slow

func (l *Logger) Slow(remoteAddr string, cost int64, request []byte, err error)

func (*Logger) Stats

func (l *Logger) Stats(arg interface{})

func (*Logger) Warn

func (l *Logger) Warn(arg ...interface{})

func (*Logger) Warnf

func (l *Logger) Warnf(ft string, arg ...interface{})

type Options

type Options struct {
	IsDebug       bool
	RotationTime  string
	LogFile       string
	StatsLogFile  string
	SlowLog       bool
	SlowLogFile   string
	AccessLog     bool
	AccessLogFile string
}

Jump to

Keyboard shortcuts

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