dlog

package
v1.8.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 2, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package dlog is shortly for deduplicated logger.

Index

Constants

View Source
const (
	Component = "component"
	Event     = "event"
	Scope     = "scope"
)

Variables

This section is empty.

Functions

func Err

func Err(err error, extra, msg string)

Err - hot path method for don't affect too much performance on errors.

func StartDedupLogger added in v1.5.0

func StartDedupLogger(ctx context.Context)

Types

type Option added in v1.8.0

type Option func(*Sanitizer)

Option customizes Sanitizer.

func WithCollapseSpaces added in v1.8.0

func WithCollapseSpaces(on bool) Option

WithCollapseSpaces collapses multiple whitespace into single spaces post-replacements.

func WithExtraRules added in v1.8.0

func WithExtraRules(rxs []Rule) Option

WithExtraRules appends extra rules after the defaults.

type Rule added in v1.8.0

type Rule struct {
	// contains filtered or unexported fields
}

Rule is a single regex-based sanitization step.

type Sanitizer added in v1.8.0

type Sanitizer struct {
	// contains filtered or unexported fields
}

Sanitizer applies an ordered set of sanitization rules.

func NewLogSanitizer added in v1.8.0

func NewLogSanitizer(opts ...Option) *Sanitizer

NewLogSanitizer builds a Sanitizer with a conservative, production-ready rule set. Order matters: some rules rely on previous placeholders.

func (*Sanitizer) Sanitize added in v1.8.0

func (s *Sanitizer) Sanitize(err error) string

Sanitize sanitizes a message string according to the configured rules.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL