Versions in this module Expand all Collapse all v1 v1.0.0 May 21, 2026 Changes in this version + const AsyncBlock + const AsyncDropNewest + const AsyncDropOldest + const CriticalLevel + const DebugLevel + const ErrorLevel + const FieldError + const FieldLevel + const FieldLogger + const FieldMessage + const FieldTime + const InfoLevel + const TraceLevel + const WarnLevel + var Any = xfield.Any + var Bool = xfield.Bool + var Custom = xfield.Custom + var CustomFn = xfield.CustomFunc + var Duration = xfield.Duration + var Err = xfield.Err + var Error = xfield.Error + var Float64 = xfield.Float64 + var Int = xfield.Int + var Int64 = xfield.Int64 + var String = xfield.String + var Time = xfield.Time + var Uint = xfield.Uint + var Uint64 = xfield.Uint64 + func ContextWithFields(ctx context.Context, fields ...Field) context.Context + func IntoContext(ctx context.Context, logger *Logger) context.Context + type AsyncPolicy = xcore.AsyncPolicy + type AtomicLevel = xcore.AtomicLevel + func NewAtomicLevel(level Level) *AtomicLevel + type CheckedEntry struct + func (e *CheckedEntry) Write(fields ...Field) + type Config struct + AsyncBuffer int + AsyncPolicy AsyncPolicy + Caller bool + CallerSkip int + Clock func() time.Time + ContextFields func(context.Context) []Field + Core Core + Encoder Encoder + Fields []Field + Level Level + Leveler LevelEnabler + Observer Observer + Pretty PrettyMode + SampleFirst uint64 + SampleThereafter uint64 + Stacktrace *Level + TimeLayout string + UseAsync bool + Writer io.Writer + func DefaultConfig() Config + type ContextLogger struct + func (c *ContextLogger) Critical(ctx context.Context, msg string, fields ...Field) + func (c *ContextLogger) Debug(ctx context.Context, msg string, fields ...Field) + func (c *ContextLogger) Enabled(level Level) bool + func (c *ContextLogger) Error(ctx context.Context, msg string, fields ...Field) + func (c *ContextLogger) Info(ctx context.Context, msg string, fields ...Field) + func (c *ContextLogger) Level() Level + func (c *ContextLogger) Log(ctx context.Context, level Level, msg string, fields ...Field) + func (c *ContextLogger) Logger() *Logger + func (c *ContextLogger) Sync() error + func (c *ContextLogger) Trace(ctx context.Context, msg string, fields ...Field) + func (c *ContextLogger) Warn(ctx context.Context, msg string, fields ...Field) + func (c *ContextLogger) With(fields ...Field) *ContextLogger + type Core = xcore.Core + func NewAsyncCore(next Core, buffer int, policy AsyncPolicy, observer Observer) Core + func NewFilterCore(next Core, leveler LevelEnabler) Core + func NewHookCore(next Core, observer Observer) Core + func NewSamplerCore(next Core, first, thereafter uint64) Core + func NewTeeCore(cores ...Core) Core + type Encoder = xcore.Encoder + type Event = xcore.Event + type Field = xfield.Field + func Email(key, value string) Field + func ErrorCause(err error) Field + func ErrorChain(err error) Field + func Errors(key string, errs []error) Field + func FieldsFromContext(ctx context.Context) []Field + func Generic[T any](key string, value T, append xfield.AppendFunc[T]) Field + func Secret(key, value string) Field + func ValueOf[T xfield.Value](key string, value T) Field + type FieldEncoder = xfield.Encoder + type Level = xcore.Level + func ParseLevel(s string) (Level, error) + type LevelEnabler = xcore.LevelEnabler + type LevelReader = xcore.LevelReader + type Logger struct + func Default() *Logger + func FromContext(ctx context.Context) *Logger + func New(core Core) *Logger + func NewConsole(opts ...Option) *Logger + func NewJSON(opts ...Option) *Logger + func (l *Logger) AppendName(sub string) *Logger + func (l *Logger) Check(level Level, msg string) *CheckedEntry + func (l *Logger) CheckCritical(msg string) *CheckedEntry + func (l *Logger) CheckDebug(msg string) *CheckedEntry + func (l *Logger) CheckError(msg string) *CheckedEntry + func (l *Logger) CheckInfo(msg string) *CheckedEntry + func (l *Logger) CheckTrace(msg string) *CheckedEntry + func (l *Logger) CheckWarn(msg string) *CheckedEntry + func (l *Logger) Core() Core + func (l *Logger) Critical(msg string, fields ...Field) + func (l *Logger) Ctx() *ContextLogger + func (l *Logger) Debug(msg string, fields ...Field) + func (l *Logger) Enabled(level Level) bool + func (l *Logger) Error(msg string, fields ...Field) + func (l *Logger) Info(msg string, fields ...Field) + func (l *Logger) Level() Level + func (l *Logger) Log(level Level, msg string, fields ...Field) + func (l *Logger) Name() string + func (l *Logger) PrependName(prefix string) *Logger + func (l *Logger) ReplaceName(name string) *Logger + func (l *Logger) Sync() error + func (l *Logger) Trace(msg string, fields ...Field) + func (l *Logger) Warn(msg string, fields ...Field) + func (l *Logger) With(fields ...Field) *Logger + func (l *Logger) WithContext(ctx context.Context) *Logger + type NopCore = xcore.NopCore + type Observer = xcore.Observer + type Option func(*Config) + func WithAsync(buffer int, policy AsyncPolicy) Option + func WithAtomicLevel(level *AtomicLevel) Option + func WithCaller(enabled bool) Option + func WithCallerSkip(skip int) Option + func WithClock(clock func() time.Time) Option + func WithContextFieldExtractor(fn func(context.Context) []Field) Option + func WithCore(core Core) Option + func WithEncoder(encoder Encoder) Option + func WithFields(fields ...Field) Option + func WithLevel(level Level) Option + func WithLevelEnabler(leveler LevelEnabler) Option + func WithObserver(observer Observer) Option + func WithPretty() Option + func WithSampling(first, thereafter uint64) Option + func WithSink(writer io.Writer) Option + func WithStacktrace(level Level) Option + func WithTimeLayout(layout string) Option + func WithWriter(writer io.Writer) Option + func WithoutPretty() Option + type PrettyMode int + const PrettyAuto + const PrettyOff + const PrettyOn