logutil

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ThrottledLogger

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

ThrottledLogger limits the number of log calls during a time window. To create a new logger use NewThrottled.

func NewThrottled

func NewThrottled(n int, d time.Duration) *ThrottledLogger

NewThrottled returns a new throttled logger. The returned logger will allow up to n calls in a time period of length d.

func (*ThrottledLogger) Error

func (tl *ThrottledLogger) Error(format string, params ...interface{})

Error logs the message at the error level.

func (*ThrottledLogger) Warn

func (tl *ThrottledLogger) Warn(format string, params ...interface{})

Warn logs the message at the warning level.

func (*ThrottledLogger) Write

func (tl *ThrottledLogger) Write(p []byte) (n int, err error)

Write implements io.Writer.

Jump to

Keyboard shortcuts

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