log

package
v0.0.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Logger is a shared go-kit logger.
	Logger = log.NewNopLogger()
)

Functions

func CheckFatal

func CheckFatal(location string, err error)

CheckFatal prints an error and exits with error code 1 if err is non-nil

func Flush

func Flush() error

Flush forces the buffered logger, if configured, to flush to the underlying writer This is typically only called when the application is shutting down.

func InitLogger

func InitLogger(logFormat string, logLevel dslog.Level, buffered bool, cfg LoggerConfig) log.Logger

InitLogger initialises the global gokit logger and returns that logger.

func WarnExperimentalUse

func WarnExperimentalUse(feature string)

WarnExperimentalUse logs a warning and increments the experimental features metric.

Types

type DoNotLogError

type DoNotLogError struct{ Err error }

func (DoNotLogError) Error

func (i DoNotLogError) Error() string

func (DoNotLogError) ShouldLog

func (i DoNotLogError) ShouldLog(_ context.Context, _ time.Duration) bool

func (DoNotLogError) Unwrap

func (i DoNotLogError) Unwrap() error

type LoggerConfig

type LoggerConfig struct {
	Enabled            bool
	LogsPerSecond      float64
	LogsPerSecondBurst int
	Registry           prometheus.Registerer
}

Jump to

Keyboard shortcuts

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