log

package
v5.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Level

type Level string

Level is a string representation of log level, which can easily be passed as a parameter, in lieu of defined types in upstream logging packages.

const (
	DefaultLevel       = InfoLevel
	TraceLevel   Level = "trace"
	DebugLevel   Level = "debug"
	InfoLevel    Level = "info"
	WarnLevel    Level = "warn"
	ErrorLevel   Level = "error"
	PanicLevel   Level = "panic"
	FatalLevel   Level = "fatal"
)

Log levels.

func ParseLevel

func ParseLevel(lvl string) Level

ParseLevel takes a string level and returns the sclog Level constant. If the level is not recognized, it defaults to `sclog.InfoLevel` to swallow potential configuration errors/typos when specifying log levels. https://pkg.go.dev/github.com/sirupsen/logrus#ParseLevel

func (Level) String

func (l Level) String() string

type Logger

type Logger struct {
	*logr.Logger
}

Logger exposes logging capabilities using https://pkg.go.dev/github.com/go-logr/logr.

func NewCronLogger

func NewCronLogger(logLevel Level) *Logger

NewCronLogger creates an instance of *Logger.

func NewLogger

func NewLogger(logLevel Level) *Logger

NewLogger creates an instance of *Logger. TODO(log): Consider adopting production config from zap.

func NewLogrusLogger

func NewLogrusLogger(logrusLog *logrus.Logger) *Logger

NewLogrusLogger creates an instance of *Logger backed by the supplied logrusLog instance.

Jump to

Keyboard shortcuts

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