logger

package
v0.6.5 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: Apache-2.0 Imports: 2 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DPanicw

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

DPanicw ...

func Debugf

func Debugf(format string, args ...interface{})

Debugf ...

func Debugw

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

Debugw ...

func Errorf

func Errorf(format string, args ...interface{})

Errorf ...

func Errorw

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

Errorw ...

func Fatalf

func Fatalf(format string, args ...interface{})

Fatalf ...

func Fatalw

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

Fatalw ...

func Infof

func Infof(format string, args ...interface{})

Infof ...

func Infow

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

Infow ...

func NewLogSink

func NewLogSink() (*zap.Logger, error)

NewLogSink returns a new logger sink.

func Panicf

func Panicf(format string, args ...interface{})

Panicf ...

func Panicw

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

Panicw ...

func Printf

func Printf(format string, args ...interface{})

Printf ..

func RedirectStdLog added in v0.5.6

func RedirectStdLog(l Logger) (func(), error)

RedirectStdLog is redirecting the standard logger to the logger.

func Warnf

func Warnf(format string, args ...interface{})

Warnf ...

func Warnw

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

Warnw ...

Types

type LogFunc added in v0.5.1

type LogFunc func(string, ...interface{})

LogFunc is a bridge between Logger and any third party logger.

func (LogFunc) Printf added in v0.5.1

func (f LogFunc) Printf(msg string, args ...interface{})

Printf is a bridge between Logger and any third party logger.

type Logger

type Logger interface {
	// Log a notice statement
	Noticef(format string, v ...interface{})

	// Infof is logging an info statement.
	Infof(format string, v ...interface{})

	// Log a warning statement
	Warnf(format string, v ...interface{})

	// Log a fatal error
	Fatalf(format string, v ...interface{})

	// Log an error
	Errorf(format string, v ...interface{})

	// Log a debug statement
	Debugf(format string, v ...interface{})

	// Log a trace statement
	Tracef(format string, v ...interface{})

	// Panicf is logging a panic statement.
	Panicf(format string, v ...interface{})

	// Printf is logging a printf statement.
	Printf(format string, v ...interface{})

	// Debugw is logging a debug statement with context.
	Debugw(msg string, keysAndValues ...interface{})

	// Infow is logging an info statement with context.
	Infow(msg string, keysAndValues ...interface{})

	// Warnw is logging a warning statement with context.
	Warnw(msg string, keysAndValues ...interface{})

	// Errorw is logging an error statement with context.
	Errorw(msg string, keysAndValues ...interface{})

	// DPanicw is logging a debug panic statement with context.
	DPanicw(msg string, keysAndValues ...interface{})

	// Panicw is logging a panic statement with context.
	Panicw(msg string, keysAndValues ...interface{})

	// Fatalw is logging a fatal statement with context.
	Fatalw(msg string, keysAndValues ...interface{})
}

Logger represents a standard logging interface.

var LogSink Logger

LogSink is the logger sink.

func NewLogger

func NewLogger(o ...Opt) Logger

NewLogger is creating a new logger.

type Opt

type Opt func(*Opts)

Opt is a logger option.

func WithLogger added in v0.5.6

func WithLogger(l *zap.Logger) Opt

WithLogger is setting the logger.

type Opts

type Opts struct {
	Logger *zap.Logger
}

Opts are the options for the logger.

func (*Opts) Configure added in v0.5.5

func (o *Opts) Configure(opts ...Opt)

Configure is configuring the logger.

Jump to

Keyboard shortcuts

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