log

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

type PanicLevel = logrus.PanicLevel

Variables

This section is empty.

Functions

func Debug

func Debug(args ...interface{})

func Debugf

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

func Error

func Error(args ...interface{})

func Errorf

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

func Fatal

func Fatal(args ...interface{})

func Fatalf

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

func GetFileConn

func GetFileConn() *rotatelogs.RotateLogs

func Info

func Info(args ...interface{})

func Infof

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

func Panic

func Panic(args ...interface{})

func Panicf

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

func Println

func Println(args ...interface{})

func SetLevel

func SetLevel(logLevel logrus.Level)

func SetLogger

func SetLogger(config LogConfig) *logrus.Logger

config need to be correct JSON as string: {"filename":"default.log","maxsize":100}

func Warn

func Warn(args ...interface{})

func Warnf

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

func WithField

func WithField(key string, value string) *logrus.Entry

Types

type DFormatter

type DFormatter struct {
	TimestampFormat string
}

func (*DFormatter) Format

func (f *DFormatter) Format(entry *logrus.Entry) ([]byte, error)

type LogConfig

type LogConfig struct {
	Filename        string        // 日志文件
	RetainFileCount uint          // 保留日志文件数量
	WithMaxAge      time.Duration // 日志保留时间
	IsDevelop       bool          // 开发模式会输出日志到标准输出
	FileSplitTime   time.Duration // 日志文件拆分时间间隔 time.Hour*24
}

Jump to

Keyboard shortcuts

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