logger

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2023 License: Apache-2.0 Imports: 1 Imported by: 1

Documentation

Overview

Package logger provides a logger interface that is available to gadgets and runtimes.

Index

Constants

View Source
const (
	PanicLevel = log.PanicLevel
	FatalLevel = log.FatalLevel
	ErrorLevel = log.ErrorLevel
	WarnLevel  = log.WarnLevel
	InfoLevel  = log.InfoLevel
	DebugLevel = log.DebugLevel
	TraceLevel = log.TraceLevel
)

we use the log levels from logrus here

Variables

This section is empty.

Functions

This section is empty.

Types

type DedicatedLogger added in v0.15.0

type DedicatedLogger interface {
	Panic(params ...any)
	Panicf(fmt string, params ...any)
	Fatal(params ...any)
	Fatalf(fmt string, params ...any)
	Error(params ...any)
	Errorf(fmt string, params ...any)
	Warn(params ...any)
	Warnf(fmt string, params ...any)
	Info(params ...any)
	Infof(fmt string, params ...any)
	Debug(params ...any)
	Debugf(fmt string, params ...any)
	Trace(params ...any)
	Tracef(fmt string, params ...any)
}

type DedicatedLoggerWithLevelSetter added in v0.15.0

type DedicatedLoggerWithLevelSetter interface {
	DedicatedLogger
	LevelGetterSetter
}

type GenericLogger added in v0.15.0

type GenericLogger interface {
	Log(severity Level, params ...any)
	Logf(severity Level, format string, params ...any)
}

type GenericLoggerWithLevelSetter added in v0.15.0

type GenericLoggerWithLevelSetter interface {
	GenericLogger
	LevelGetterSetter
}

type Level

type Level = log.Level

type LevelGetterSetter added in v0.15.0

type LevelGetterSetter interface {
	SetLevel(Level)
	GetLevel() Level
}

type Logger

type Logger interface {
	DedicatedLogger
	GenericLogger
	LevelGetterSetter
}

func DefaultLogger

func DefaultLogger() Logger

func NewFromDedicatedLogger added in v0.15.0

func NewFromDedicatedLogger(logger DedicatedLoggerWithLevelSetter) Logger

func NewFromGenericLogger added in v0.15.0

func NewFromGenericLogger(logger GenericLoggerWithLevelSetter) Logger

type StandardDedicatedLogger added in v0.15.0

type StandardDedicatedLogger struct {
	GenericLoggerWithLevelSetter
}

func (*StandardDedicatedLogger) Debug added in v0.15.0

func (s *StandardDedicatedLogger) Debug(params ...any)

func (*StandardDedicatedLogger) Debugf added in v0.15.0

func (s *StandardDedicatedLogger) Debugf(fmt string, params ...any)

func (*StandardDedicatedLogger) Error added in v0.15.0

func (s *StandardDedicatedLogger) Error(params ...any)

func (*StandardDedicatedLogger) Errorf added in v0.15.0

func (s *StandardDedicatedLogger) Errorf(fmt string, params ...any)

func (*StandardDedicatedLogger) Fatal added in v0.15.0

func (s *StandardDedicatedLogger) Fatal(params ...any)

func (*StandardDedicatedLogger) Fatalf added in v0.15.0

func (s *StandardDedicatedLogger) Fatalf(fmt string, params ...any)

func (*StandardDedicatedLogger) Info added in v0.15.0

func (s *StandardDedicatedLogger) Info(params ...any)

func (*StandardDedicatedLogger) Infof added in v0.15.0

func (s *StandardDedicatedLogger) Infof(fmt string, params ...any)

func (*StandardDedicatedLogger) Panic added in v0.15.0

func (s *StandardDedicatedLogger) Panic(params ...any)

func (*StandardDedicatedLogger) Panicf added in v0.15.0

func (s *StandardDedicatedLogger) Panicf(fmt string, params ...any)

func (*StandardDedicatedLogger) Trace added in v0.15.0

func (s *StandardDedicatedLogger) Trace(params ...any)

func (*StandardDedicatedLogger) Tracef added in v0.15.0

func (s *StandardDedicatedLogger) Tracef(fmt string, params ...any)

func (*StandardDedicatedLogger) Warn added in v0.15.0

func (s *StandardDedicatedLogger) Warn(params ...any)

func (*StandardDedicatedLogger) Warnf added in v0.15.0

func (s *StandardDedicatedLogger) Warnf(fmt string, params ...any)

type StandardGenericLogger added in v0.15.0

type StandardGenericLogger struct {
	DedicatedLoggerWithLevelSetter
}

func (*StandardGenericLogger) Log added in v0.15.0

func (s *StandardGenericLogger) Log(severity Level, params ...any)

func (*StandardGenericLogger) Logf added in v0.15.0

func (s *StandardGenericLogger) Logf(severity Level, format string, params ...any)

Jump to

Keyboard shortcuts

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