throttledlogger

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2023 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LoggingFunc

type LoggingFunc func(string, ...interface{})

type ThrottledLogger

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

ThrottledLogger is a logger that throttles the output, i.e. it only logs a message if a certain amount of time has passed since the last log message

func NewThrottledLogger

func NewThrottledLogger(logger log.Logger, throttlingInterval time.Duration) *ThrottledLogger

func (*ThrottledLogger) Debugf

func (t *ThrottledLogger) Debugf(format string, args ...interface{})

func (*ThrottledLogger) Infof

func (t *ThrottledLogger) Infof(format string, args ...interface{})

type Timer

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

func NewTimer

func NewTimer(tickInterval time.Duration) *Timer

func (*Timer) IntervalPassed

func (t *Timer) IntervalPassed(now time.Time) bool

func (*Timer) Tick

func (t *Timer) Tick(now time.Time)

Jump to

Keyboard shortcuts

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