Versions in this module Expand all Collapse all v6 v6.0.0 Oct 15, 2023 Changes in this version + const DateMicroLayout + const DateMilliLayout + const DateNanoLayout + const MicroLayout + const MilliLayout + const NanoLayout + func IsValidLevel(l Level) bool + type AppendFunc = func(*Buffer) + type Buffer struct + func NewBuffer(detail bool) *Buffer + func (w *Buffer) Append(v ...any) *Buffer + func (w *Buffer) AppendBuffer(f func(b *Buffer)) *Buffer + func (w *Buffer) AppendBytes(b ...byte) *Buffer + func (w *Buffer) AppendFloat(n float64, fmt byte, prec, bitSize int) *Buffer + func (w *Buffer) AppendFunc(f AppendFunc) *Buffer + func (w *Buffer) AppendInt(n int64, base int) *Buffer + func (w *Buffer) AppendString(s string) *Buffer + func (w *Buffer) AppendTime(t time.Time, layout string) *Buffer + func (w *Buffer) AppendUint(n uint64, base int) *Buffer + func (w *Buffer) Appendf(format string, v ...any) *Buffer + func (w *Buffer) Appendln(v ...any) *Buffer + func (w *Buffer) Bytes() []byte + func (w *Buffer) Detail() bool + func (w *Buffer) Free() + func (w *Buffer) Print(v ...any) + func (w *Buffer) Printf(f string, v ...any) + func (w *Buffer) Println(v ...any) + func (w *Buffer) Reset(detail bool) *Buffer + func (w *Buffer) Write(b []byte) (int, error) + type Handler interface + Handle func(*Record) + func MergeHandler(w ...Handler) Handler + func NewDispatchHandler(d map[Level]Handler) Handler + func NewJSONHandler(w ...io.Writer) Handler + func NewNopHandler() Handler + func NewTermHandler(w io.Writer, foreColors map[Level]colors.Color) Handler + func NewTextHandler(w ...io.Writer) Handler + type HandlerFunc func(*Record) + func (w HandlerFunc) Handle(e *Record) + type Level int8 + const LevelDebug + const LevelError + const LevelFatal + const LevelInfo + const LevelTrace + const LevelWarn + func ParseLevel(s string) (Level, error) + func (l *Level) UnmarshalText(data []byte) error + func (l Level) MarshalText() ([]byte, error) + func (l Level) String() string + type Logger interface + Error func(err error) + Print func(v ...any) + Printf func(format string, v ...any) + Println func(v ...any) + StdLogger func() *log.Logger + String func(s string) + With func(name string, val any) Logger + type Logs struct + func New(h Handler, o ...Option) *Logs + func (l *Logs) SLog() *slog.Logger + func (l *Logs) SLogHandler() slog.Handler + func (logs *Logs) CreatedFormat() string + func (logs *Logs) DEBUG() Logger + func (logs *Logs) ERROR() Logger + func (logs *Logs) Enable(level ...Level) + func (logs *Logs) FATAL() Logger + func (logs *Logs) HasLocation() bool + func (logs *Logs) INFO() Logger + func (logs *Logs) IsEnable(l Level) bool + func (logs *Logs) Logger(lv Level) Logger + func (logs *Logs) NewRecord(lv Level) *Record + func (logs *Logs) SetCreated(v string) + func (logs *Logs) SetHandler(h Handler) + func (logs *Logs) SetLocation(v bool) + func (logs *Logs) TRACE() Logger + func (logs *Logs) WARN() Logger + func (logs *Logs) With(lv Level, params map[string]any) Logger + type Option func(*Logs) + func WithCreated(layout string) Option + func WithDetail(v bool) Option + func WithLocale(p *localeutil.Printer) Option + func WithLocation(v bool) Option + type Pair struct + K string + V any + type Record struct + AppendCreated AppendFunc + AppendLocation AppendFunc + AppendMessage AppendFunc + Level Level + Params []Pair + func (e *Record) DepthError(depth int, err error) + func (e *Record) DepthPrint(depth int, v ...any) + func (e *Record) DepthPrintf(depth int, format string, v ...any) + func (e *Record) DepthPrintln(depth int, v ...any) + func (e *Record) DepthString(depth int, s string) + func (e *Record) Error(err error) + func (e *Record) Logs() *Logs + func (e *Record) Print(v ...any) + func (e *Record) Printf(format string, v ...any) + func (e *Record) Println(v ...any) + func (e *Record) StdLogger() *log.Logger + func (e *Record) String(s string) + func (e *Record) With(name string, val any) Logger Other modules containing this package github.com/issue9/logs github.com/issue9/logs/v2 github.com/issue9/logs/v3 github.com/issue9/logs/v4 github.com/issue9/logs/v5 github.com/issue9/logs/v7