blogrus

package
v0.0.0-...-c113072 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultTimestampFormat = "2006-1-2 15:04:05.000"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BFormatter

type BFormatter struct {
	TimestampFormat string // 时间序列格式 default: DefaultTimestampFormat = "2006-1-2 15:04:05.000"
	HideKeys        bool   // WriteField字段是否隐藏其key值
	NoColor         bool   // 是否禁用颜色输出
	ShowFullLevel   bool   // 是否显示日志级别所有内容例如[WARNING],否则[W]
	TrimMessages    bool   // 是否移除末尾的空行
	// contains filtered or unexported fields
}

func NewDefaultBFormatter

func NewDefaultBFormatter() *BFormatter

func (*BFormatter) Format

func (self *BFormatter) Format(entry *logrus.Entry) ([]byte, error)

func (*BFormatter) WriteCaller

func (self *BFormatter) WriteCaller(entry *logrus.Entry)

func (*BFormatter) WriteCommon

func (self *BFormatter) WriteCommon(entry *logrus.Entry)

func (*BFormatter) WriteFields

func (self *BFormatter) WriteFields(entry *logrus.Entry)

func (*BFormatter) WriteLevel

func (self *BFormatter) WriteLevel(entry *logrus.Entry)

func (*BFormatter) WriteMessages

func (self *BFormatter) WriteMessages(entry *logrus.Entry)

func (*BFormatter) WriteTime

func (self *BFormatter) WriteTime(entry *logrus.Entry)

type FileWriter

type FileWriter struct {
	FileName string
	MaxSize  int64
	MaxLines int
	Daily    bool
	// contains filtered or unexported fields
}

func NewDefaultFileWriter

func NewDefaultFileWriter(filename string, maxSize int64, maxLines int) *FileWriter

func (*FileWriter) Write

func (self *FileWriter) Write(p []byte) (n int, err error)

type MultiWriter

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

func NewDefaultMultiWriter

func NewDefaultMultiWriter(filename string, maxSize int64, maxLines int) *MultiWriter

func (*MultiWriter) Write

func (self *MultiWriter) Write(p []byte) (n int, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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