logging

package
v0.0.0-...-e2b2867 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2020 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncoderConfigs

func EncoderConfigs() []zapf.EncoderConfigOption

EncoderConfigs returns the zapf.EncoderConfigOption.

func ISO8601TimeEncoder

func ISO8601TimeEncoder(t time.Time, enc zapcore.PrimitiveArrayEncoder)

ISO8601TimeEncoder serializes a time.Time to an ISO8601-formatted string with millisecond precision. This is same as t.Format("2006-01-02T15:04:05.000Z").

It optimized at byte slice level, faster than time.Format.

Types

type Logger

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

Logger represents a logr.Logger embedded logger.

func NewLogger

func NewLogger(debug bool, zapfOpts ...zapf.Opts) *Logger

NewLogger returns the new zapr implemented logr.Logger.

func (*Logger) Enabled

func (l *Logger) Enabled() bool

Enabled implements logr.Logger.Enabled.

func (*Logger) Error

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

Error implements logr.Logger.Error.

func (*Logger) Info

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

Info implements logr.Logger.Info.

func (*Logger) V

func (l *Logger) V(level int) logr.Logger

V implements logr.Logger.V.

func (*Logger) WithName

func (l *Logger) WithName(name string) logr.Logger

WithName implements logr.Logger.WithName.

func (*Logger) WithValues

func (l *Logger) WithValues(keysAndValues ...interface{}) logr.Logger

WithValues implements logr.Logger.WithValues.

Jump to

Keyboard shortcuts

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