loglimit

package
v0.0.0-...-5c79d48 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Context is a context to signal stops, cancellations.
	Context context.Context
	// MessageSubstrings contains a list of substrings belonging to the
	// logs that should be deduplicated.
	MessageSubstrings []string
	// Clock is a clock to override in tests, set to real time clock
	// by default.
	Clock clockwork.Clock
}

Config contains the log limiter config.

type LogLimiter

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

LogLimiter deduplicates logs over a certain time window.

func New

func New(config Config) (*LogLimiter, error)

New creates a new log limiter.

func (*LogLimiter) Log

func (l *LogLimiter) Log(entry *log.Entry, level log.Level, args ...any)

Log deduplicates log entries that should be deduplicated.

Jump to

Keyboard shortcuts

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