Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewPretty ¶
NewPretty wraps w with an NDJSON pretty-printer.
Each newline-delimited JSON record is reformatted into a single human-readable line with a dimmed timestamp, a colored level, the message, and remaining fields as key=value pairs. Lines that fail to parse as JSON pass through unchanged. Safe for concurrent use.
Drop-in for any NDJSON producer — jsoncore, the zap/zerolog/slog contribs, or any other backend that writes JSON-per-line.
Types ¶
type FileConfig ¶
type FileConfig struct {
MaxSize int64
MaxBackups int
Compress bool
Mode os.FileMode
Clock func() time.Time
}
func DefaultFileConfig ¶
func DefaultFileConfig() FileConfig
type FileOption ¶
type FileOption func(*FileConfig)
func WithClock ¶
func WithClock(clock func() time.Time) FileOption
func WithCompress ¶
func WithCompress(enabled bool) FileOption
func WithFileMode ¶
func WithFileMode(mode os.FileMode) FileOption
func WithMaxBackups ¶
func WithMaxBackups(count int) FileOption
func WithMaxSize ¶
func WithMaxSize(bytes int64) FileOption
Click to show internal directories.
Click to hide internal directories.