Versions in this module Expand all Collapse all v5 v5.2.0 Sep 18, 2023 Changes in this version + const DateMicroLayout + const DateMilliLayout + const DateNanoLayout v5.1.0 Aug 10, 2023 Changes in this version type Logs + func (l *Logs) SLog() *slog.Logger + func (l *Logs) SLogHandler() slog.Handler v5.0.0 Jul 15, 2023 Changes in this version + const MicroLayout + const MilliLayout + const NanoLayout + func Caller(l *Logs) + func Created(l *Logs) + func IsValidLevel(l Level) bool + type HandleFunc func(*Record) + func (w HandleFunc) Handle(e *Record) + type Handler interface + Handle func(*Record) + func MergeHandler(w ...Handler) Handler + func NewDispatchHandler(d map[Level]Handler) Handler + func NewJSONHandler(timeLayout string, w ...io.Writer) Handler + func NewNopHandler() Handler + func NewTermHandler(timeLayout string, w io.Writer, foreColors map[Level]colors.Color) Handler + func NewTextHandler(timeLayout string, w ...io.Writer) Handler + 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 (logs *Logs) DEBUG() Logger + func (logs *Logs) ERROR() Logger + func (logs *Logs) Enable(level ...Level) + func (logs *Logs) FATAL() Logger + func (logs *Logs) HasCaller() bool + func (logs *Logs) HasCreated() 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) SetCaller(v bool) + func (logs *Logs) SetCreated(v bool) + func (logs *Logs) SetHandler(h Handler) + 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) + type Pair struct + K string + V any + type Record struct + Created time.Time + Level Level + Line int + Message string + Params []Pair + Path string + 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/v6 github.com/issue9/logs/v7