logger

package
v0.28.5 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2022 License: Apache-2.0 Imports: 12 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GlobalLogLevel = 1

	Log = New()
)

Functions

func EnableGroupSession

func EnableGroupSession(logger interface{}) func()

Types

type Colors

type Colors struct {
	Info  color.Attribute
	Error color.Attribute
	Key   color.Attribute
}

type GroupedLogger

type GroupedLogger interface {
	Grouped(state bool)
}

type Logger added in v0.28.0

type Logger interface {
	Enabled() bool
	Info(msg string, keysAndValues ...interface{})
	Error(err error, msg string, keysAndValues ...interface{})
	V(level int) Logger
	WithValues(keysAndValues ...interface{}) Logger
	WithName(name string) Logger

	GetLogrLogger() logr.Logger
}

func New

func New(options ...Option) Logger

func NewWithLogrLogger added in v0.28.2

func NewWithLogrLogger(logger logr.Logger) Logger

type LogrAdapter added in v0.28.2

type LogrAdapter struct {
	logr.Logger
}

func (*LogrAdapter) GetLogrLogger added in v0.28.2

func (log *LogrAdapter) GetLogrLogger() logr.Logger

func (*LogrAdapter) V added in v0.28.2

func (log *LogrAdapter) V(level int) Logger

func (*LogrAdapter) WithName added in v0.28.2

func (log *LogrAdapter) WithName(name string) Logger

func (*LogrAdapter) WithValues added in v0.28.2

func (log *LogrAdapter) WithValues(keysAndValues ...interface{}) Logger

type Option added in v0.13.0

type Option func(*SpinnerLogSink)

func CheckMarkCharacter

func CheckMarkCharacter(m rune) Option

func Color

func Color(colors Colors) Option

func Err

func Err(w io.Writer) Option

func ErrorMarkCharacter

func ErrorMarkCharacter(m rune) Option

func Grouppable

func Grouppable() Option

func Out

func Out(w io.Writer) Option

func SeparatorCharacter

func SeparatorCharacter(m rune) Option

func Truncate

func Truncate() Option

func WithName

func WithName(name string) Option

func WithTime

func WithTime(format string) Option

type SpinnerLogSink added in v0.28.0

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

func NewSpinnerLogSink added in v0.28.0

func NewSpinnerLogSink(options ...Option) *SpinnerLogSink

func (*SpinnerLogSink) AddName added in v0.28.3

func (log *SpinnerLogSink) AddName(name string)

func (*SpinnerLogSink) AddValues added in v0.28.3

func (log *SpinnerLogSink) AddValues(keyAndValues []interface{})

func (*SpinnerLogSink) Copy added in v0.28.3

func (log *SpinnerLogSink) Copy() *SpinnerLogSink

func (*SpinnerLogSink) Enabled added in v0.28.0

func (log *SpinnerLogSink) Enabled(level int) bool

Enabled implements logr.LogSink interface

func (*SpinnerLogSink) Error added in v0.28.0

func (log *SpinnerLogSink) Error(e error, msg string, keysAndValues ...interface{})

Error implements logr.LogSink interface

func (*SpinnerLogSink) GetGrouppable added in v0.28.3

func (log *SpinnerLogSink) GetGrouppable() bool

func (*SpinnerLogSink) GetShowTime added in v0.28.3

func (log *SpinnerLogSink) GetShowTime() bool

func (*SpinnerLogSink) GetSpinner added in v0.28.3

func (log *SpinnerLogSink) GetSpinner() *spinner.Spinner

func (*SpinnerLogSink) GetValues added in v0.28.3

func (log *SpinnerLogSink) GetValues() []interface{}

func (*SpinnerLogSink) Grouped added in v0.28.0

func (log *SpinnerLogSink) Grouped(state bool)

func (*SpinnerLogSink) Info added in v0.28.0

func (log *SpinnerLogSink) Info(level int, msg string, keysAndValues ...interface{})

Info implements logr.LogSink interface

func (*SpinnerLogSink) Init added in v0.28.0

func (log *SpinnerLogSink) Init(_ logr.RuntimeInfo)

func (*SpinnerLogSink) InitSpinner added in v0.28.3

func (log *SpinnerLogSink) InitSpinner()

func (*SpinnerLogSink) SetDisableColor added in v0.28.4

func (log *SpinnerLogSink) SetDisableColor(disableColor bool)

func (*SpinnerLogSink) SetGrouppable added in v0.28.3

func (log *SpinnerLogSink) SetGrouppable(state bool)

func (*SpinnerLogSink) SetOptions added in v0.28.0

func (log *SpinnerLogSink) SetOptions(options ...Option)

func (*SpinnerLogSink) SetShowTime added in v0.28.3

func (log *SpinnerLogSink) SetShowTime(time bool)

func (*SpinnerLogSink) ShowTime added in v0.28.0

func (log *SpinnerLogSink) ShowTime(f bool) *SpinnerLogSink

func (*SpinnerLogSink) StopSpinner added in v0.28.3

func (log *SpinnerLogSink) StopSpinner()

func (*SpinnerLogSink) WithName added in v0.28.0

func (log *SpinnerLogSink) WithName(name string) logr.LogSink

WithName implements logr.LogSink interface

func (*SpinnerLogSink) WithValues added in v0.28.0

func (log *SpinnerLogSink) WithValues(keysAndValues ...interface{}) logr.LogSink

WithValues implements logr.LogSink interface

Jump to

Keyboard shortcuts

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