Documentation
¶
Overview ¶
Package wlog @Author Bing @Date 2024/2/21 16:18:00 @Desc
Package wlog @Author Bing @Date 2024/8/14 17:12:00 @Desc
Package wlog @Author Bing @Date 2024/2/21 18:29:00 @Desc
Package wlog @Author Bing @Date 2024/8/12 15:16: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
- Variables
- func CallFrame()
- func CallFramesDepth(depths ...int)
- func Debug(msg string)
- func DebugValues(values ...any)
- func Debugf(f string, msg ...any)
- func Debugln(msg ...any)
- func Error(msg string)
- func ErrorValues(values ...any)
- func Errorf(f string, msg ...any)
- func Errorln(msg ...any)
- func Fatal(msg string)
- func FatalValues(values ...any)
- func Fatalf(f string, msg ...any)
- func Fatalln(msg ...any)
- func Info(msg string)
- func InfoValues(values ...any)
- func Infof(f string, msg ...any)
- func Infoln(msg ...any)
- func Json()
- func Panic(msg string)
- func PanicValues(values ...any)
- func Panicf(f string, msg ...any)
- func Panicln(msg ...any)
- func Parser(express string, handle func() error) (*cronTask, error)
- func Print(msg string)
- func Printf(f string, msg ...any)
- func Println(msg ...any)
- func Text()
- func Values(values ...any)
- func Warn(msg string)
- func Warnf(f string, msg ...any)
- func Warnln(msg ...any)
- func WithField(key string, value any)
- func WithFields(fields map[string]any)
- func WithKeys(kes ...string)
- type BufferPool
- type Cycle
- type DefaultBufferPool
- type DefaultEntryPool
- type Entry
- func (e *Entry) CallFrame(depth int) *runtime.Frame
- func (e *Entry) Cron(express string)
- func (e *Entry) Debug(msg string)
- func (e *Entry) Dup() *Entry
- func (e *Entry) Error(msg string)
- func (e *Entry) Fatal(msg string)
- func (e *Entry) Info(msg string)
- func (e *Entry) Log(level Level, msg string)
- func (e *Entry) Panic(msg string)
- func (e *Entry) Warn(msg string)
- type EntryPool
- type Fields
- type File
- type JsonFormat
- type Level
- type Log
- func (l *Log) CallFrame()
- func (l *Log) CallFramesDepth(depths ...int)
- func (l *Log) Console()
- func (l *Log) Debug(msg string)
- func (l *Log) DebugValues(values ...any)
- func (l *Log) Debugf(format string, msg ...any)
- func (l *Log) Debugln(msg ...any)
- func (l *Log) Error(msg string)
- func (l *Log) ErrorValues(values ...any)
- func (l *Log) Errorf(format string, msg ...any)
- func (l *Log) Errorln(msg ...any)
- func (l *Log) Fatal(msg string)
- func (l *Log) FatalValues(values ...any)
- func (l *Log) Fatalf(format string, msg ...any)
- func (l *Log) Fatalln(msg ...any)
- func (l *Log) Formatter(f ReportFormat)
- func (l *Log) Info(msg string)
- func (l *Log) InfoValues(values ...any)
- func (l *Log) Infof(format string, msg ...any)
- func (l *Log) Infoln(msg ...any)
- func (l *Log) Json()
- func (l *Log) JsonColorDisable(timeFormat string)
- func (l *Log) JsonFormatDetail(timeFormat string, disableTime, disableColor, disableLevel bool)
- func (l *Log) JsonTime(timeFormat string)
- func (l *Log) JsonTimeDisable()
- func (l *Log) Level(level Level) bool
- func (l *Log) Output(output io.Writer)
- func (l *Log) Panic(msg string)
- func (l *Log) PanicValues(values ...any)
- func (l *Log) Panicf(format string, msg ...any)
- func (l *Log) Panicln(msg ...any)
- func (l *Log) Print(msg string)
- func (l *Log) Printf(f string, msg ...any)
- func (l *Log) Println(msg ...any)
- func (l *Log) SetLevel(level Level)
- func (cron Log) Start()
- func (cron Log) Stop()
- func (l *Log) Text()
- func (l *Log) TextColorDisable(timeFormat string)
- func (l *Log) TextFormatDetail(timeFormat string, disableTime, disableColor, disableLevel bool)
- func (l *Log) TextTime(timeFormat string)
- func (l *Log) TextTimeDisable()
- func (l *Log) Values(values ...any) *Log
- func (l *Log) Warn(msg string)
- func (l *Log) WarnValues(values ...any)
- 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 map[string]any)
- func (l *Log) WithKeys(keys ...string)
- type Mu
- type ReportFormat
- type Task
- type TaskFunc
- type TextFormat
Constants ¶
Variables ¶
var (
Cron *cron
)
Functions ¶
func CallFramesDepth ¶ added in v1.2.13
func CallFramesDepth(depths ...int)
func DebugValues ¶ added in v1.3.14
func DebugValues(values ...any)
func ErrorValues ¶ added in v1.3.14
func ErrorValues(values ...any)
func FatalValues ¶ added in v1.3.14
func FatalValues(values ...any)
func InfoValues ¶ added in v1.3.14
func InfoValues(values ...any)
func PanicValues ¶ added in v1.3.14
func PanicValues(values ...any)
func WithFields ¶ added in v1.3.14
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 Entry ¶ added in v1.1.0
type Entry struct {
// contains filtered or unexported fields
}
type File ¶ added in v1.2.13
type File struct { Name string Postfix string // file destination path Path string // file size byte Max float64 Size float64 // number of file backup Number int // cycle Cycle Cycle Expression string // contains filtered or unexported fields }
func NewFileCycle ¶ added in v1.2.13
func NewFileInfo ¶ added in v1.2.13
func NewFileInfo() *File
func NewFileName ¶ added in v1.2.13
func NewFileTest ¶ added in v1.2.13
func NewFileTest() *File
type JsonFormat ¶ added in v1.1.0
type JsonFormat struct { TimeFormat string // time format DisableTime bool DisableLevel bool DisableColor bool }
func NewFormatJson ¶ added in v1.2.13
func NewFormatJson() *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 // log output format : json/text // file *File // contains filtered or unexported fields }
func NewEntryPool ¶ added in v1.1.0
func NewLog ¶ added in v1.2.13
func NewLog(level Level, file *File, format ReportFormat) *Log
NewLog create info logger
func NewLogConfig ¶ added in v1.2.13
func NewLogConfig(level Level, callFrame bool, callFrameDepth int, isOutput bool, output io.Writer, file *File, format ReportFormat) *Log
NewLogConfig create default logger
func NewLogInfoJson ¶ added in v1.2.13
func NewLogInfoJson() *Log
func (*Log) CallFramesDepth ¶ added in v1.2.13
func (*Log) Console ¶ added in v1.2.13
func (l *Log) Console()
Console enable default console output log
func (*Log) DebugValues ¶ added in v1.3.14
func (*Log) ErrorValues ¶ added in v1.3.14
func (*Log) FatalValues ¶ added in v1.3.14
func (*Log) Formatter ¶ added in v1.2.13
func (l *Log) Formatter(f ReportFormat)
Formatter custom log formatter
func (*Log) InfoValues ¶ added in v1.3.14
func (*Log) Json ¶ added in v1.2.13
func (l *Log) Json()
Json SetJsonFormat define log output format
func (*Log) JsonColorDisable ¶ added in v1.2.13
func (*Log) JsonFormatDetail ¶ added in v1.2.13
func (*Log) JsonTimeDisable ¶ added in v1.2.13
func (l *Log) JsonTimeDisable()
func (*Log) PanicValues ¶ added in v1.3.14
func (*Log) Text ¶ added in v1.2.13
func (l *Log) Text()
Text SetJsonFormat define log output format
func (*Log) TextColorDisable ¶ added in v1.2.13
func (*Log) TextFormatDetail ¶ added in v1.2.13
func (*Log) TextTimeDisable ¶ added in v1.2.13
func (l *Log) TextTimeDisable()
func (*Log) WarnValues ¶ added in v1.3.14
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 NewFormatText ¶ added in v1.2.13
func NewFormatText() *TextFormat