logger

package
v0.0.0-...-fd5f2df Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GlobalLogger

func GlobalLogger() (logger *zap.SugaredLogger)

func NewZapCustom

func NewZapCustom(options ...zap.Option) (*zap.Logger, error)

NewZapCustom builds a custom Logger that writes InfoLevel and above logs to standard error in a human-friendly format.

It's a shortcut for newZapCustomConfig().Build(...Option).

func SetGlobalLogger

func SetGlobalLogger(l *zap.SugaredLogger)

SetLogger supports setting external logger for the library.

Types

type Fake

type Fake struct {
}

func NewFake

func NewFake() *Fake

func (*Fake) Error

func (*Fake) Error(...interface{})

func (*Fake) Errorf

func (*Fake) Errorf(string, ...interface{})

func (*Fake) Fatal

func (*Fake) Fatal(...interface{})

func (*Fake) Fatalf

func (*Fake) Fatalf(string, ...interface{})

func (*Fake) Info

func (*Fake) Info(...interface{})

func (*Fake) Infof

func (*Fake) Infof(string, ...interface{})

func (*Fake) Infow

func (*Fake) Infow(string, ...interface{})

func (*Fake) Named

func (f *Fake) Named(string) Logger

func (*Fake) Warn

func (*Fake) Warn(...interface{})

func (*Fake) Warnf

func (*Fake) Warnf(string, ...interface{})

func (*Fake) With

func (f *Fake) With(...interface{}) Logger

type Logger

type Logger interface {
	// recursion doesn't
	Named(name string) Logger
	With(args ...interface{}) Logger

	Info(args ...interface{})
	Infof(template string, args ...interface{})
	Infow(msg string, keysAndValues ...interface{})
	Warn(args ...interface{})
	Warnf(template string, args ...interface{})
	Error(args ...interface{})
	Errorf(template string, args ...interface{})
	Fatal(args ...interface{})
	Fatalf(template string, args ...interface{})
}

func Must

func Must(service string) Logger

Jump to

Keyboard shortcuts

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