Documentation ¶
Index ¶
- Constants
- type BFormatter
- func (self *BFormatter) Format(entry *logrus.Entry) ([]byte, error)
- func (self *BFormatter) WriteCaller(entry *logrus.Entry)
- func (self *BFormatter) WriteCommon(entry *logrus.Entry)
- func (self *BFormatter) WriteFields(entry *logrus.Entry)
- func (self *BFormatter) WriteLevel(entry *logrus.Entry)
- func (self *BFormatter) WriteMessages(entry *logrus.Entry)
- func (self *BFormatter) WriteTime(entry *logrus.Entry)
- type FileWriter
- type MultiWriter
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) 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
type MultiWriter ¶
type MultiWriter struct {
// contains filtered or unexported fields
}
func NewDefaultMultiWriter ¶
func NewDefaultMultiWriter(filename string, maxSize int64, maxLines int) *MultiWriter
Click to show internal directories.
Click to hide internal directories.