logger

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2022 License: Apache-2.0 Imports: 4 Imported by: 18

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debugw

func Debugw(msg string, keysAndValues ...interface{})

func Errorw

func Errorw(msg string, err error, keysAndValues ...interface{})

func GetLogger

func GetLogger() logr.Logger

GetLogger returns the logger that was set with SetLogger with an extra depth of 1

func Infow

func Infow(msg string, keysAndValues ...interface{})

func InitFromConfig

func InitFromConfig(conf Config, name string)

InitFromConfig initializes a Zap-based logger

func ParseZapLevel

func ParseZapLevel(level string) zapcore.Level

func SetLogger

func SetLogger(l logr.Logger, name string)

SetLogger lets you use a custom logger. Pass in a logr.Logger with default depth

func Warnw

func Warnw(msg string, err error, keysAndValues ...interface{})

Types

type Config

type Config struct {
	JSON   bool   `yaml:"json"`
	Level  string `yaml:"level"`
	Sample bool   `yaml:"sample,omitempty"`
	// when sampling, the first N logs will be logged
	SampleInitial int `yaml:"sampleInitial,omitempty"`
	// when sampling, every Mth log will be logged
	SampleInterval int `yaml:"sampleInitial,omitempty"`
}

type Logger

type Logger logr.Logger

func GetDefaultLogger

func GetDefaultLogger() Logger

GetDefaultLogger returns the logger that was set but with LiveKit wrappers

func (Logger) Debugw

func (l Logger) Debugw(msg string, keysAndValues ...interface{})

func (Logger) Errorw

func (l Logger) Errorw(msg string, err error, keysAndValues ...interface{})

func (Logger) Infow

func (l Logger) Infow(msg string, keysAndValues ...interface{})

func (Logger) Warnw

func (l Logger) Warnw(msg string, err error, keysAndValues ...interface{})

Jump to

Keyboard shortcuts

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