log

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2021 License: ISC Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger interface {
	Info(s string)
	Infof(s string, a ...interface{})
	Debug(s string)
	Debugf(s string, a ...interface{})
	Warn(s string)
	Warnf(s string, a ...interface{})
	Error(err error, s string)
	Errorf(err error, s string, a ...interface{})
	Fatal(err error, s string)
	Fatalf(err error, s string, a ...interface{})
}

Logger provides a basic logging definition that can be implemented by various log implementations and then passed as a dependency to code that requires logging.

type Noop

type Noop struct {
}

Noop does nothing.

func (Noop) Debug

func (n Noop) Debug(s string)

Debug writes a debug level log.

func (Noop) Debugf

func (n Noop) Debugf(s string, a ...interface{})

Debugf writes a debug level log.

func (Noop) Error

func (n Noop) Error(err error, s string)

Error writes an error log.

func (Noop) Errorf

func (n Noop) Errorf(err error, s string, a ...interface{})

Errorf writes an error log.

func (Noop) Fatal

func (n Noop) Fatal(err error, s string)

Fatal writes a fatal log which will immediately terminate the program.

func (Noop) Fatalf

func (n Noop) Fatalf(err error, s string, a ...interface{})

Fatalf writes a fatal log which will immediately terminate the program.

func (Noop) Info

func (n Noop) Info(s string)

Info writes an info level log.

func (Noop) Infof

func (n Noop) Infof(s string, a ...interface{})

Infof writes an info level log with args.

func (Noop) Warn

func (n Noop) Warn(s string)

Warn writes a warning level log.

func (Noop) Warnf

func (n Noop) Warnf(s string, a ...interface{})

Warnf writes a warning level log.

type Zero

type Zero struct {
}

Zero implements the Logger interface using zerolog.

func NewZero

func NewZero(cfg *config.Logging) *Zero

NewZero will create and return a new log using zero.

func (Zero) Debug

func (z Zero) Debug(s string)

Debug writes a debug level log.

func (Zero) Debugf

func (z Zero) Debugf(s string, a ...interface{})

Debugf writes a debug level log.

func (Zero) Error

func (z Zero) Error(err error, s string)

Error writes an error log.

func (Zero) Errorf

func (z Zero) Errorf(err error, s string, a ...interface{})

Errorf writes an error log.

func (Zero) Fatal

func (z Zero) Fatal(err error, s string)

Fatal writes a fatal log which will immediately terminate the program.

func (Zero) Fatalf

func (z Zero) Fatalf(err error, s string, a ...interface{})

Fatalf writes a fatal log which will immediately terminate the program.

func (Zero) Info

func (z Zero) Info(s string)

Info writes an info level log.

func (Zero) Infof

func (z Zero) Infof(s string, a ...interface{})

Infof writes an info level log with args.

func (Zero) Warn

func (z Zero) Warn(s string)

Warn writes a warning level log.

func (Zero) Warnf

func (z Zero) Warnf(s string, a ...interface{})

Warnf writes a warning level log.

Jump to

Keyboard shortcuts

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