Versions in this module Expand all Collapse all v1 v1.0.0 Sep 8, 2026 v0 v0.2.1 Jul 29, 2026 v0.2.0 Jul 29, 2026 Changes in this version + const KindAny + const KindBool + const KindDuration + const KindFloat64 + const KindGroup + const KindInt64 + const KindLogValuer + const KindString + const KindTime + const KindUint64 + const LevelKey + const MessageKey + const Name + const SourceKey + const TimeKey + const Version + var TimeFormat = "2006/01/02 15:04.05.000" + func ConfigureRecordLimiter(ratePerSecond, burst int) + func Countdown(msg string, seconds int) + func Debug(msg string, args ...any) + func DebugContext(ctx context.Context, msg string, args ...any) + func Debugf(format string, args ...any) + func DebugfContext(ctx context.Context, format string, args ...any) + func DefaultCallerSkipPrefixes() []string + func DisableDLPLogger() + func DisableJSONLogger() + func DisableTextLogger() + func EnableDLPLogger() + func EnableDiagnosticsLogging(on bool, writer ...io.Writer) + func EnableJSONLogger() + func EnableTextLogger() + func Error(msg string, args ...any) + func ErrorContext(ctx context.Context, msg string, args ...any) + func Errorf(format string, args ...any) + func ErrorfContext(ctx context.Context, format string, args ...any) + func Fatal(msg string, args ...any) + func Fatalf(format string, args ...any) + func GetErrorComponent(err error) string + func GetErrorOperation(err error) string + func Info(msg string, args ...any) + func InfoContext(ctx context.Context, msg string, args ...any) + func Infof(format string, args ...any) + func InfofContext(ctx context.Context, format string, args ...any) + func IsDLPEnabled() bool + func IsErrorType(err error, errorType ErrorType) bool + func ListFormatters() []string + func Loading(msg string, seconds int) + func NewLogLogger(h Handler, level Level) *log.Logger + func NewWriter(filename ...string) *writer + func Printf(format string, args ...any) + func Println(msg string, args ...any) + func Progress(msg string, durationMs int) + func RegisterCallerSkipPrefix(prefix string) + func RegisterDefaultCallerSkipPrefixes() + func RegisterFormatter(name string, fn FormatterFunc) string + func RegisteredModules() []string + func RemoveFormatter(id string) bool + func ResetCallerSkipPrefixes(prefixes ...string) + func SetAttrFormatterOrder(order ...AttrFormatterRule) + func SetContextPropagator(fn ContextPropagatorFunc) + func SetDefault(logger any) + func SetLevel(level any) error + func SetLevelDebug() + func SetLevelError() + func SetLevelFatal() + func SetLevelInfo() + func SetLevelTrace() + func SetLevelWarn() + func SetRecordRouter(router RecordRouter) + func SetTimeFormat(format string) + func Subscribe(size uint16) (<-chan SubscriptionEvent, context.CancelFunc) + func SubscribeWithOptions(options SubscribeOptions) (<-chan SubscriptionEvent, context.CancelFunc) + func Trace(msg string, args ...any) + func TraceContext(ctx context.Context, msg string, args ...any) + func Tracef(format string, args ...any) + func TracefContext(ctx context.Context, format string, args ...any) + func UpdateModuleConfig(name string, config modules.Config) error + func UseModuleWithError(module modules.Module) error + func Warn(msg string, args ...any) + func WarnContext(ctx context.Context, msg string, args ...any) + func Warnf(format string, args ...any) + func WarnfContext(ctx context.Context, format string, args ...any) + type Attr = stdslog.Attr + func Any(key string, v any) Attr + func Bool(key string, v bool) Attr + func Duration(key string, v time.Duration) Attr + func Float64(key string, v float64) Attr + func Group(key string, args ...any) Attr + func GroupAttrs(key string, attrs ...Attr) Attr + func Int(key string, v int) Attr + func Int64(key string, v int64) Attr + func String(key string, v string) Attr + func Time(key string, v time.Time) Attr + func Uint64(key string, v uint64) Attr + type AttrFormatterRule int + const AttrFormatterRuleLevel + const AttrFormatterRuleSource + const AttrFormatterRuleTime + type Config struct + AddSource bool + EnableJSON *bool + EnableText *bool + LogInternalErrors bool + MaxFormatCacheSize int64 + NoColor bool + StringBuilderPoolSize int + TimeFormat string + func DefaultConfig() *Config + func (c *Config) InheritJSONOutput() + func (c *Config) InheritTextOutput() + func (c *Config) SetEnableJSON(enabled bool) + func (c *Config) SetEnableText(enabled bool) + type ContextPropagatorFunc func(ctx context.Context) []Attr + type ErrorType int + const ErrorTypeConfiguration + const ErrorTypeInitialization + const ErrorTypeInternal + const ErrorTypeInvalidInput + const ErrorTypeProcessing + func (et ErrorType) String() string + type Fields struct + type FormatterFunc func(groups []string, attr Attr) (Value, bool) + type GlobalConfig struct + DefaultLevel Level + DefaultNoColor bool + DefaultSource bool + DefaultWriter io.Writer + EnableJSON bool + EnableText bool + type Handler = stdslog.Handler + var DiscardHandler Handler = discardHandler{} + func ApplyModulesToHandler(baseHandler Handler, moduleList []modules.Module) Handler + func NewConsoleHandler(w io.Writer, noColor bool, opts *HandlerOptions) Handler + type HandlerOptions = stdslog.HandlerOptions + func NewOptions(options *HandlerOptions) *HandlerOptions + type JSONHandler = stdslog.JSONHandler + func NewJSONHandler(w io.Writer, opts *HandlerOptions) *JSONHandler + type Kind = stdslog.Kind + type Level = stdslog.Level + const LevelDebug + const LevelError + const LevelFatal + const LevelInfo + const LevelTrace + const LevelWarn + func GetLevel() Level + func SetLogLoggerLevel(level Level) (oldLevel Level) + type LevelVar = stdslog.LevelVar + type Leveler = stdslog.Leveler + type LogValuer = stdslog.LogValuer + type Logger struct + func Default(modules ...string) *Logger + func GetGlobalLogger() *Logger + func NewGELFLogger(w io.Writer, opts *HandlerOptions, gopts *gelfmod.Options) *Logger + func NewLogfmtLogger(w io.Writer, opts *HandlerOptions) *Logger + func NewLogger(w io.Writer, noColor, addSource bool) *Logger + func NewLoggerWithConfig(w io.Writer, config *Config) *Logger + func ResetGlobalLogger(w io.Writer, noColor, addSource bool) *Logger + func UseModule(module modules.Module) *Logger + func With(args ...any) *Logger + func WithGroup(name string) *Logger + func WithValue(key string, val any) *Logger + func (l *Logger) Countdown(msg string, seconds int, writer ...io.Writer) + func (l *Logger) Debug(msg string, args ...any) + func (l *Logger) DebugContext(ctx context.Context, msg string, args ...any) + func (l *Logger) Debugf(format string, args ...any) + func (l *Logger) DebugfContext(ctx context.Context, format string, args ...any) + func (l *Logger) Diagnostics() []ModuleDiagnostics + func (l *Logger) Enabled(ctx context.Context, level Level) bool + func (l *Logger) Error(msg string, args ...any) + func (l *Logger) ErrorContext(ctx context.Context, msg string, args ...any) + func (l *Logger) Errorf(format string, args ...any) + func (l *Logger) ErrorfContext(ctx context.Context, format string, args ...any) + func (l *Logger) Fatal(msg string, args ...any) + func (l *Logger) FatalContext(ctx context.Context, msg string, args ...any) + func (l *Logger) Fatalf(format string, args ...any) + func (l *Logger) FatalfContext(ctx context.Context, format string, args ...any) + func (l *Logger) GetLevel() Level + func (l *Logger) GetSlogLogger() *SlogLogger + func (l *Logger) Handler() Handler + func (l *Logger) Info(msg string, args ...any) + func (l *Logger) InfoContext(ctx context.Context, msg string, args ...any) + func (l *Logger) Infof(format string, args ...any) + func (l *Logger) InfofContext(ctx context.Context, format string, args ...any) + func (l *Logger) Loading(msg string, seconds int, writer ...io.Writer) + func (l *Logger) Log(ctx context.Context, level Level, msg string, args ...any) + func (l *Logger) LogAttrs(ctx context.Context, level Level, msg string, attrs ...Attr) + func (l *Logger) Printf(format string, args ...any) + func (l *Logger) Println(msg string, args ...any) + func (l *Logger) Progress(msg string, durationMs int, writer ...io.Writer) + func (l *Logger) SetLevel(level any) *Logger + func (l *Logger) Trace(msg string, args ...any) + func (l *Logger) TraceContext(ctx context.Context, msg string, args ...any) + func (l *Logger) Tracef(format string, args ...any) + func (l *Logger) TracefContext(ctx context.Context, format string, args ...any) + func (l *Logger) UpdateModuleConfig(name string, config modules.Config) error + func (l *Logger) Use(module modules.Module) *Logger + func (l *Logger) UseWithError(module modules.Module) error + func (l *Logger) Warn(msg string, args ...any) + func (l *Logger) WarnContext(ctx context.Context, msg string, args ...any) + func (l *Logger) Warnf(format string, args ...any) + func (l *Logger) WarnfContext(ctx context.Context, format string, args ...any) + func (l *Logger) With(args ...any) *Logger + func (l *Logger) WithContext(ctx context.Context) *Logger + func (l *Logger) WithDeadline(d time.Time) (*Logger, context.CancelFunc) + func (l *Logger) WithGroup(name string) *Logger + func (l *Logger) WithModules(modules ...modules.Module) *Logger + func (l *Logger) WithTimeout(timeout time.Duration) (*Logger, context.CancelFunc) + func (l *Logger) WithValue(key string, val any) *Logger + type LoggerBuilder struct + func NewLoggerBuilder() *LoggerBuilder + func (b *LoggerBuilder) Build() *Logger + func (b *LoggerBuilder) EnableDLP(on bool) *LoggerBuilder + func (b *LoggerBuilder) EnableJSON(on bool) *LoggerBuilder + func (b *LoggerBuilder) EnableText(on bool) *LoggerBuilder + func (b *LoggerBuilder) UseGELF(opts *gelfmod.Options) *LoggerBuilder + func (b *LoggerBuilder) UseLogfmt() *LoggerBuilder + func (b *LoggerBuilder) UseNetOutput(opts *outputnet.SenderOption) *LoggerBuilder + func (b *LoggerBuilder) WithAttrs(attrs ...Attr) *LoggerBuilder + func (b *LoggerBuilder) WithConfig(cfg *Config) *LoggerBuilder + func (b *LoggerBuilder) WithGroup(name string) *LoggerBuilder + func (b *LoggerBuilder) WithModule(name string) *LoggerBuilder + func (b *LoggerBuilder) WithWriter(w io.Writer) *LoggerBuilder + type LoggerManager struct + func GetManager() *LoggerManager + func (lm *LoggerManager) Configure(config *GlobalConfig) error + func (lm *LoggerManager) GetDefault() *Logger + func (lm *LoggerManager) GetNamed(name string) *Logger + func (lm *LoggerManager) GetStats() ManagerStats + func (lm *LoggerManager) ListInstances() []string + func (lm *LoggerManager) Reset() + func (lm *LoggerManager) Shutdown() + type ManagerStats struct + DefaultLoggerExists bool + InstanceCount int + InstanceNames []string + type ModuleDiagnostics struct + Enabled bool + Healthy *bool + Metrics map[string]any + Name string + Priority int + Type modules.ModuleType + func CollectModuleDiagnostics() []ModuleDiagnostics + type MultiHandler struct + func NewMultiHandler(handlers ...Handler) *MultiHandler + func (h *MultiHandler) Enabled(ctx context.Context, level Level) bool + func (h *MultiHandler) Handle(ctx context.Context, r Record) error + func (h *MultiHandler) WithAttrs(attrs []Attr) Handler + func (h *MultiHandler) WithGroup(name string) Handler + type Record = stdslog.Record + func NewRecord(t time.Time, level Level, msg string, pc uintptr) Record + type RecordRouter func(record Record) []string + type RuntimeSnapshot struct + DLPEnabled bool + DLPVersion int64 + JSONEnabled bool + Level Level + Message string + TextEnabled bool + func ApplyRuntimeOption(option, value string) (RuntimeSnapshot, error) + func GetRuntimeSnapshot() RuntimeSnapshot + type SlogError struct + Actual string + Cause error + Component string + Details map[string]any + Expected string + Field string + Operation string + Type ErrorType + func NewConfigurationError(component, field string, cause error) *SlogError + func NewDLPError(operation, field string, cause error) *SlogError + func NewFormatterError(operation string, cause error) *SlogError + func NewInitializationError(component, operation string, cause error) *SlogError + func NewInternalError(component, operation string, cause error) *SlogError + func NewInvalidInputError(field, expected, actual string) *SlogError + func NewModuleError(moduleName, operation string, cause error) *SlogError + func NewProcessingError(component, operation string, cause error) *SlogError + func (e *SlogError) Error() string + func (e *SlogError) GetDetails() map[string]any + func (e *SlogError) Unwrap() error + func (e *SlogError) WithDetails(key string, value any) *SlogError + type SlogLogger = stdslog.Logger + func GetSlogLogger() *SlogLogger + func New(handler Handler) *SlogLogger + func StdDefault() *SlogLogger + type Source = stdslog.Source + type StdLogger = stdslog.Logger + type SubscribeOptions struct + Backpressure SubscriptionBackpressurePolicy + BlockTimeout time.Duration + BufferSize uint16 + type SubscriberStats struct + Backpressure SubscriptionBackpressurePolicy + BlockTimeout time.Duration + BufferSize int + CreatedAt time.Time + Delivered uint64 + Dropped uint64 + DroppedNewest uint64 + DroppedOldest uint64 + DroppedTimed uint64 + HighWatermark uint64 + ID int64 + Published uint64 + QueueLen int + State string + func GetSubscriberStats(id int64) (SubscriberStats, bool) + func ListSubscriberStats() []SubscriberStats + type SubscriptionBackpressurePolicy string + const SubscriptionBlockWithTimeout + const SubscriptionDropNewest + const SubscriptionDropOldest + type SubscriptionEvent struct + Format string + Record Record + Rendered string + type SubscriptionStats struct + ActiveSubscribers int + ClosedSubscribers int + ClosingSubscribers int + Delivered uint64 + Dropped uint64 + DroppedNewest uint64 + DroppedOldest uint64 + DroppedTimed uint64 + Evicted uint64 + Published uint64 + Subscribers int + func GetSubscriptionStats() SubscriptionStats + type TextHandler = stdslog.TextHandler + func NewTextHandler(w io.Writer, opts *HandlerOptions) *TextHandler + type Value = stdslog.Value + func AnyValue(v any) Value + func BoolValue(v bool) Value + func DurationValue(v time.Duration) Value + func Float64Value(v float64) Value + func GroupValue(args ...Attr) Value + func Int64Value(v int64) Value + func IntValue(v int) Value + func StringValue(value string) Value + func TimeValue(v time.Time) Value + func Uint64Value(v uint64) Value