logging

package
v1.29.5 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RateLimit

func RateLimit(next log.Logger, limit rate.Limit) log.Logger

RateLimit write to a logger.

Types

type Deduper

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

Deduper implement log.Logger, dedupes log lines.

func Dedupe

func Dedupe(next log.Logger, repeat time.Duration) *Deduper

Dedupe log lines to next, only repeating every repeat duration.

func (*Deduper) Log

func (d *Deduper) Log(keyvals ...interface{}) error

Log implements log.Logger.

func (*Deduper) Stop

func (d *Deduper) Stop()

Stop the Deduper.

type JSONFileLogger

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

JSONFileLogger represents a logger that writes JSON to a file.

func NewJSONFileLogger

func NewJSONFileLogger(s string) (*JSONFileLogger, error)

NewJSONFileLogger returns a new JSONFileLogger.

func (*JSONFileLogger) Close

func (l *JSONFileLogger) Close() error

Close closes the underlying file.

func (*JSONFileLogger) Log

func (l *JSONFileLogger) Log(i ...interface{}) error

Log calls the Log function of the underlying logger.

Jump to

Keyboard shortcuts

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