Documentation
¶
Overview ¶
Package wlog @Author Bing @Date 2024/2/21 16:18:00 @Desc
Package wlog @Author Bing @Date 2024/2/21 18:29:00 @Desc
Package wlog @Author Bing @Date 2024/2/22 16:32:00 @Desc
Package wlog @Author Bing @Date 2024/2/25 19:26:00 @Desc
Package wlog @Author Bing @Date 2024/2/27 15:57:00 @Desc
Package wlog @Author Bing @Date 2024/2/21 16:34:00 @Desc
Package wlog @Author Bing @Date 2024/2/2 15:38:00 @Desc
Package wlog @Author Bing @Date 2024/2/22 17:18:00 @Desc
Package wlog @Author Bing @Date 2024/2/22 15:13:00 @Desc
Index ¶
- Constants
- func Debug(msg string)
- func Debugf(f string, msg ...any)
- func Debugln(msg ...any)
- func Error(msg string)
- func Errorf(f string, msg ...any)
- func Errorln(msg ...any)
- func Fatal(msg string)
- func Fatalf(f string, msg ...any)
- func Fatalln(msg ...any)
- func Info(msg string)
- func Infof(f string, msg ...any)
- func Infoln(msg ...any)
- func NewEntryPool(l *Log)
- func Panic(msg string)
- func Panicf(f string, msg ...any)
- func Panicln(msg ...any)
- func Print()
- func Printf()
- func Println()
- func ReportCal()
- func Warn(msg string)
- func Warnf(f string, msg ...any)
- func Warnln(msg ...any)
- type BufferPool
- type DefaultBufferPool
- type DefaultEntryPool
- type Entry
- type EntryPool
- type Fields
- type JsonFormat
- type Level
- type Log
- func (l *Log) Debug(msg string)
- func (l *Log) Debugf(format string, msg ...any)
- func (l *Log) Debugln(msg ...any)
- func (l *Log) Error(msg string)
- func (l *Log) Errorf(format string, msg ...any)
- func (l *Log) Errorln(msg ...any)
- func (l *Log) Fatal(msg string)
- func (l *Log) Fatalf(format string, msg ...any)
- func (l *Log) Fatalln(msg ...any)
- func (l *Log) Info(msg string)
- func (l *Log) Infof(format string, msg ...any)
- func (l *Log) Infoln(msg ...any)
- func (l *Log) Panic(msg string)
- func (l *Log) Panicf(format string, msg ...any)
- func (l *Log) Panicln(msg ...any)
- func (l *Log) Print()
- func (l *Log) Printf()
- func (l *Log) Println()
- func (l *Log) ReportCaller()
- func (l *Log) SetFormatter(f ReportFormat)
- func (l *Log) SetJsonColorDisable(timeFormat string)
- func (l *Log) SetJsonFormat()
- func (l *Log) SetJsonFormatDetail(timeFormat string, disableTime, disableColor, disableLevel bool)
- func (l *Log) SetJsonTime(timeFormat string)
- func (l *Log) SetJsonTimeDisable()
- func (l *Log) SetLevel(level Level)
- func (l *Log) SetOutput(output io.Writer)
- func (l *Log) SetTextColorDisable(timeFormat string)
- func (l *Log) SetTextFormatDetail(timeFormat string, disableTime, disableColor, disableLevel bool)
- func (l *Log) SetTextTime(timeFormat string)
- func (l *Log) SetTextTimeDisable()
- func (l *Log) Warn(msg string)
- func (l *Log) Warnf(format string, msg ...any)
- func (l *Log) Warnln(msg ...any)
- func (l *Log) WithField(key string, value any)
- func (l *Log) WithFields(fields Fields)
- type Mu
- type ReportFormat
- type TextFormat
Constants ¶
Variables ¶
This section is empty.
Functions ¶
func NewEntryPool ¶ added in v1.1.0
func NewEntryPool(l *Log)
Types ¶
type BufferPool ¶ added in v1.1.0
BufferPool interface
type DefaultBufferPool ¶ added in v1.1.0
type DefaultBufferPool struct {
// contains filtered or unexported fields
}
func (*DefaultBufferPool) Get ¶ added in v1.1.0
func (p *DefaultBufferPool) Get() *bytes.Buffer
func (*DefaultBufferPool) Set ¶ added in v1.1.0
func (p *DefaultBufferPool) Set(b *bytes.Buffer)
type DefaultEntryPool ¶ added in v1.1.0
type DefaultEntryPool struct {
// contains filtered or unexported fields
}
func (*DefaultEntryPool) Get ¶ added in v1.1.0
func (d *DefaultEntryPool) Get() *Entry
func (*DefaultEntryPool) Set ¶ added in v1.1.0
func (d *DefaultEntryPool) Set(e *Entry)
type JsonFormat ¶ added in v1.1.0
type JsonFormat struct {
TimeFormat string // time format
DisableTime bool
DisableLevel bool
DisableColor bool
}
func DefaultJsonFormat ¶ added in v1.2.2
func DefaultJsonFormat() *JsonFormat
func (*JsonFormat) Format ¶ added in v1.1.0
func (j *JsonFormat) Format(entry *Entry) ([]byte, error)
func (*JsonFormat) Parse ¶ added in v1.1.0
func (j *JsonFormat) Parse(e *Entry) Fields
type Log ¶ added in v1.1.0
type Log struct {
// format
Format ReportFormat
// contains filtered or unexported fields
}
func (*Log) ReportCaller ¶ added in v1.2.8
func (l *Log) ReportCaller()
func (*Log) SetFormatter ¶ added in v1.2.4
func (l *Log) SetFormatter(f ReportFormat)
SetFormatter custom log formatter
func (*Log) SetJsonColorDisable ¶ added in v1.2.12
func (*Log) SetJsonFormat ¶ added in v1.2.2
func (l *Log) SetJsonFormat()
SetJsonFormat define log output format
func (*Log) SetJsonFormatDetail ¶ added in v1.2.12
func (*Log) SetJsonTime ¶ added in v1.2.12
func (*Log) SetJsonTimeDisable ¶ added in v1.2.12
func (l *Log) SetJsonTimeDisable()
func (*Log) SetTextColorDisable ¶ added in v1.2.12
func (*Log) SetTextFormatDetail ¶ added in v1.2.12
func (*Log) SetTextTime ¶ added in v1.2.12
func (*Log) SetTextTimeDisable ¶ added in v1.2.12
func (l *Log) SetTextTimeDisable()
func (*Log) WithFields ¶ added in v1.1.0
WithFields appends fields to log
type ReportFormat ¶ added in v1.1.0
ReportFormat interface
type TextFormat ¶ added in v1.2.2
type TextFormat struct {
// TimeFormat
TimeFormat string
// Disable
DisableTime bool
DisableLevel bool
DisableColor bool
}
func DefaultTextFormat ¶ added in v1.2.2
func DefaultTextFormat() *TextFormat
Click to show internal directories.
Click to hide internal directories.