logr

package module
v0.0.0-...-f8a288c Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2023 License: Apache-2.0 Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPacketLogr

func NewPacketLogr(opts ...LoggerOption) (logr.Logger, *zap.Logger, error)

NewPacketLogr is the opionated packet logger setup

Types

type LoggerOption

type LoggerOption func(*PacketLogr)

LoggerOption for setting optional values

func WithEnableErrLogsToStderr

func WithEnableErrLogsToStderr(enable bool) LoggerOption

WithEnableErrLogsToStderr sends .Error logs to stderr

func WithEnableRollbar

func WithEnableRollbar(enable bool) LoggerOption

WithEnableRollbar sends error logs to Rollbar service

func WithKeysAndValues

func WithKeysAndValues(kvs []interface{}) LoggerOption

WithKeysAndValues adds extra key/value fields

func WithLogLevel

func WithLogLevel(level string) LoggerOption

WithLogLevel sets the log level

func WithOutputPaths

func WithOutputPaths(paths []string) LoggerOption

WithOutputPaths adds output paths

func WithRollbarConfig

func WithRollbarConfig(config rollbarConfig) LoggerOption

WithRollbarConfig customizes the Rollbar details

func WithServiceName

func WithServiceName(name string) LoggerOption

WithServiceName adds a service name a logged field

type PacketLogr

type PacketLogr struct {
	logr.Logger
	// contains filtered or unexported fields
}

PacketLogr is a wrapper around zap.SugaredLogger

Jump to

Keyboard shortcuts

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