Documentation
¶
Index ¶
- func ClearLogs()
- func DurStr(d time.Duration) string
- func Fatalf(f string, v ...any)
- type Handler
- func (h *Handler) Enabled(_ context.Context, l slog.Level) bool
- func (h *Handler) Handle(_ context.Context, r slog.Record) error
- func (h *Handler) SetLinePrefix(prefix string)
- func (h *Handler) SetTimeFormat(format string)
- func (h *Handler) WithAttrs(attrs []slog.Attr) slog.Handler
- func (h *Handler) WithGroup(name string) slog.Handler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Handler ¶ added in v0.11.0
type Handler struct {
// contains filtered or unexported fields
}
Handler is an slog.Handler that produces the same pretty colored output as the original templier log package.
func NewHandler ¶ added in v0.11.0
NewHandler creates a new colored slog.Handler writing to out. The level controls which messages are emitted. LinePrefix defaults to "🤖 " and TimeFormat defaults to "3:04:05.000 PM".
func (*Handler) SetLinePrefix ¶ added in v0.11.0
SetLinePrefix sets the prefix printed at the beginning of each log line.
func (*Handler) SetTimeFormat ¶ added in v0.11.0
SetTimeFormat sets the time format string used for timestamps.
Click to show internal directories.
Click to hide internal directories.