logutils

package
Version: v0.0.0-...-e560ebb Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2021 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package logutils contains general logging helpers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ThrottledInfoLogger

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

ThrottledInfoLogger logs messages at info level throttled to some frequency.

func NewThrottledInfoLogger

func NewThrottledInfoLogger(logger logging.Logger, delay time.Duration) *ThrottledInfoLogger

NewThrottledInfoLogger returns a logger that logs messages at info level no more than once every delay interval.

func (*ThrottledInfoLogger) MaybeLog

func (t *ThrottledInfoLogger) MaybeLog(message string)

MaybeLog logs the given message if the last message successfully logged is older than a prespecified delay.

Jump to

Keyboard shortcuts

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