log

package
v0.38.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	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 InitLogger

func InitLogger(cfg *server.Config)

InitLogger initialises the global gokit logger (util_log.Logger) and overrides the default logger for the server.

func LevelFilter

func LevelFilter(l string) level.Option

TODO(dannyk): remove once weaveworks/common updates to go-kit/log

-> we can then revert to using Level.Gokit

func NewPrometheusLogger

func NewPrometheusLogger(l dskit.Level, format string) (log.Logger, error)

NewPrometheusLogger creates a new instance of PrometheusLogger which exposes Prometheus counters for various log levels.

Types

type PrometheusLogger

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

PrometheusLogger exposes Prometheus counters for each of go-kit's log levels.

func (*PrometheusLogger) Log

func (pl *PrometheusLogger) Log(kv ...interface{}) error

Log increments the appropriate Prometheus counter depending on the log level.

Jump to

Keyboard shortcuts

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