Versions in this module Expand all Collapse all v0 v0.4.0 Jul 16, 2022 Changes in this version + const LvlDebug + const LvlError + const LvlFatal + const LvlInfo + const LvlInvalid + const LvlTrace + const LvlWarning + var BCodeLineDetail = false + var CtxNil = ContextAllowTar(&ContextNil{}) + var Stdout = &TargetStdout + func BuiltinTimeFmtCompact(buff *strings.Builder, t time.Time) + func BuiltinTimeFmtStandard(buff *strings.Builder, t time.Time) + func GlobalLevel() int + func SetDefaultTargets(ts []Target) + func SetGlobalHandler(h LoggerHandler) + func SetGlobalHandlerConfig(cfg *HandlerConfig) + func SetGlobalLevel(l int) int + type Context interface + Clear func() + FD func(key string, val float64) Context + FI func(key string, val int64) Context + FS func(key string, val string) Context + FT func(key string, val FmtField) Context + FU func(key string, val uint64) Context + FX func(key string, val uint64) Context + Level func() int + P func(msg string) Context + PF func(format string, args ...interface{}) Context + Pre func(prefix string) Context + SetLevel func(level int) + Z func() + func DBG() Context + func ERR() Context + func FAT() Context + func INF() Context + func TRC() Context + func WAR() Context + type ContextAllowTar interface + Tar func(t Target) ContextAllowTar + UniTar func(t Target) Context + type ContextBase struct + Common *HandlerCommon + func NewContextBase(c *HandlerCommon, level int) *ContextBase + func (ctx *ContextBase) Clear() + func (ctx *ContextBase) FD(key string, val float64) Context + func (ctx *ContextBase) FI(key string, val int64) Context + func (ctx *ContextBase) FS(key string, val string) Context + func (ctx *ContextBase) FT(key string, val FmtField) Context + func (ctx *ContextBase) FU(key string, val uint64) Context + func (ctx *ContextBase) FX(key string, val uint64) Context + func (ctx *ContextBase) Level() int + func (ctx *ContextBase) P(msg string) Context + func (ctx *ContextBase) PF(msg string, args ...interface{}) Context + func (ctx *ContextBase) Pre(prefix string) Context + func (ctx *ContextBase) SetLevel(level int) + func (ctx *ContextBase) Tar(t Target) ContextAllowTar + func (ctx *ContextBase) UniTar(t Target) Context + func (ctx *ContextBase) Z() + type ContextBaseAssembleFunc func(*ContextBase) string + type ContextNil struct + func (ctx *ContextNil) Clear() + func (ctx *ContextNil) FD(key string, val float64) Context + func (ctx *ContextNil) FI(key string, val int64) Context + func (ctx *ContextNil) FS(key string, val string) Context + func (ctx *ContextNil) FT(key string, val FmtField) Context + func (ctx *ContextNil) FU(key string, val uint64) Context + func (ctx *ContextNil) FX(key string, val uint64) Context + func (ctx *ContextNil) Level() int + func (ctx *ContextNil) P(msg string) Context + func (ctx *ContextNil) PF(format string, args ...interface{}) Context + func (ctx *ContextNil) Pre(prefix string) Context + func (ctx *ContextNil) SetLevel(l int) + func (ctx *ContextNil) Tar(t Target) ContextAllowTar + func (ctx *ContextNil) UniTar(t Target) Context + func (ctx *ContextNil) Z() + type ContextPool struct + func NewContextPool(common *HandlerCommon, size int) *ContextPool + func (p *ContextPool) Get(level int) ContextAllowTar + type FFArrFloat64 []float64 + func (f FFArrFloat64) AssembleAsJSON(buff *strings.Builder, com *HandlerCommon) + func (f FFArrFloat64) AssembleAsLineSeparator(buff *strings.Builder, com *HandlerCommon) + type FFArrInt64 []int64 + func (f FFArrInt64) AssembleAsJSON(buff *strings.Builder, com *HandlerCommon) + func (f FFArrInt64) AssembleAsLineSeparator(buff *strings.Builder, com *HandlerCommon) + type FFArrString []string + func (f FFArrString) AssembleAsJSON(buff *strings.Builder, com *HandlerCommon) + func (f FFArrString) AssembleAsLineSeparator(buff *strings.Builder, com *HandlerCommon) + type FFArrUint64 []uint64 + func (f FFArrUint64) AssembleAsJSON(buff *strings.Builder, com *HandlerCommon) + func (f FFArrUint64) AssembleAsLineSeparator(buff *strings.Builder, com *HandlerCommon) + type FFMapStringFloat64 map[string]float64 + func (f FFMapStringFloat64) AssembleAsJSON(buff *strings.Builder, com *HandlerCommon) + func (f FFMapStringFloat64) AssembleAsLineSeparator(buff *strings.Builder, com *HandlerCommon) + type FFMapStringInt64 map[string]int64 + func (f FFMapStringInt64) AssembleAsJSON(buff *strings.Builder, com *HandlerCommon) + func (f FFMapStringInt64) AssembleAsLineSeparator(buff *strings.Builder, com *HandlerCommon) + type FFMapStringString map[string]string + func (f FFMapStringString) AssembleAsJSON(buff *strings.Builder, com *HandlerCommon) + func (f FFMapStringString) AssembleAsLineSeparator(buff *strings.Builder, com *HandlerCommon) + type FFMapStringUint64 map[string]uint64 + func (f FFMapStringUint64) AssembleAsJSON(buff *strings.Builder, com *HandlerCommon) + func (f FFMapStringUint64) AssembleAsLineSeparator(buff *strings.Builder, com *HandlerCommon) + type FmtField interface + AssembleAsJSON func(*strings.Builder, *HandlerCommon) + AssembleAsLineSeparator func(*strings.Builder, *HandlerCommon) + type FuncTimeFmt func(*strings.Builder, time.Time) + type Handler struct + func NewHandlerWithConfig(cfg *HandlerConfig) *Handler + func (h *Handler) AddPrefix(key, val string) + func (h *Handler) AddTarget(t Target) + func (h *Handler) BindTimeFmt(f FuncTimeFmt) + func (h *Handler) Clone() LoggerHandler + func (h *Handler) Ctx() ContextAllowTar + func (h *Handler) DBG() ContextAllowTar + func (h *Handler) DelPrefix(key string) + func (h *Handler) DelTarget(name string) + func (h *Handler) ERR() ContextAllowTar + func (h *Handler) FAT() ContextAllowTar + func (h *Handler) INF() ContextAllowTar + func (h *Handler) Level() int + func (h *Handler) Release() + func (h *Handler) SetLevel(l int) + func (h *Handler) SetSeparator(sep string) + func (h *Handler) SwitchCodeLine(b bool) + func (h *Handler) SwitchJSONAssemble(b bool) + func (h *Handler) TRC() ContextAllowTar + func (h *Handler) WAR() ContextAllowTar + type HandlerCommon struct + BCodeLine bool + PrefixStr string + Prefixes [][2]string + Sep string + SepFmt string + Targets []Target + TimeFmt FuncTimeFmt + UseJSONAssemble bool + type HandlerConfig struct + BCodeLine bool + BUseJSONAssemble bool + ContextPoolSize int + FmtSeparator string + Level int + Separator string + func GlobalHandlerConfig() *HandlerConfig + type Logger interface + Ctx func() ContextAllowTar + DBG func() ContextAllowTar + ERR func() ContextAllowTar + FAT func() ContextAllowTar + INF func() ContextAllowTar + TRC func() ContextAllowTar + WAR func() ContextAllowTar + func Log() Logger + type LoggerHandler interface + AddPrefix func(key, val string) + AddTarget func(t Target) + BindTimeFmt func(f FuncTimeFmt) + Clone func() LoggerHandler + DelPrefix func(key string) + DelTarget func(name string) + Level func() int + Release func() + SetLevel func(l int) + SetSeparator func(sep string) + SwitchCodeLine func(b bool) + SwitchJSONAssemble func(b bool) + func GlobalHandler() LoggerHandler + func NewHandler() LoggerHandler + type RotateConfig struct + Dir string + Ext string + Prefix string + RotateDuring int64 + RotateSize int64 + type Target interface + Close func() + IncrUsing func() + IsIgnore func(l int) bool + Name func() string + Put func(msg string) + func GetDefaultTargets() []Target + type TargetFile struct + func MakeTargetFile(dir string, fn string) (*TargetFile, error) + func (t *TargetFile) Close() + func (t *TargetFile) IncrUsing() + func (t *TargetFile) IsIgnore(l int) bool + func (t *TargetFile) Name() string + func (t *TargetFile) Put(msg string) + func (t *TargetFile) ReopenFile() error + func (t *TargetFile) SetLevels(ls []int) + type TargetFileRotate struct + func MakeTargetFileRotate(cfg *RotateConfig) (*TargetFileRotate, error) + func (t *TargetFileRotate) Close() + func (t *TargetFileRotate) IncrUsing() + func (t *TargetFileRotate) IsIgnore(l int) bool + func (t *TargetFileRotate) Name() string + func (t *TargetFileRotate) Put(msg string) + func (t *TargetFileRotate) SetLevels(ls []int) + type TargetStdout struct + func (t *TargetStdout) Close() + func (t *TargetStdout) IncrUsing() + func (t *TargetStdout) IsIgnore(l int) bool + func (t *TargetStdout) Name() string + func (t *TargetStdout) Put(msg string)