logger

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2023 License: MIT Imports: 6 Imported by: 19

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Level zapcore.Level
}

func (*Config) New

func (c *Config) New() (Logger, error)

New returns a new Logger for Config.

type Logger

type Logger interface {
	Name() string
	Named(string) Logger

	Debug(args ...interface{})
	Info(args ...interface{})
	Warn(args ...interface{})
	Error(args ...interface{})
	Panic(args ...interface{})
	Fatal(args ...interface{})

	Debugf(format string, values ...interface{})
	Infof(format string, values ...interface{})
	Warnf(format string, values ...interface{})
	Errorf(format string, values ...interface{})
	Panicf(format string, values ...interface{})
	Fatalf(format string, values ...interface{})

	Debugw(msg string, keysAndValues ...interface{})
	Infow(msg string, keysAndValues ...interface{})
	Warnw(msg string, keysAndValues ...interface{})
	Errorw(msg string, keysAndValues ...interface{})
	Panicw(msg string, keysAndValues ...interface{})
	Fatalw(msg string, keysAndValues ...interface{})

	Sync() error
}

Logger is a minimal subset of smartcontractkit/chainlink/core/logger.Logger implemented by go.uber.org/zap.SugaredLogger

func New

func New() (Logger, error)

New returns a new Logger with the default configuration.

func Nop

func Nop() Logger

Nop returns a no-op Logger.

func Test

func Test(tb testing.TB) Logger

Test returns a new test Logger for tb.

func TestObserved

func TestObserved(tb testing.TB, lvl zapcore.Level) (Logger, *observer.ObservedLogs)

TestObserved returns a new test Logger for tb and ObservedLogs at the given Level.

func With

func With(l Logger, keyvals ...interface{}) Logger

With returns a Logger with keyvals, if l has a method `With(...interface{}) L`, where L implements Logger, otherwise it returns l.

Jump to

Keyboard shortcuts

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