logging

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigureLogging

func ConfigureLogging(opts ...LoggingOption) error

func IP added in v0.8.0

func IP(key string, ip net.IP) zap.Field

func IPs added in v0.8.0

func IPs(key string, ips []net.IP) zap.Field

func NewLogger

func NewLogger(underlyingLogger *zap.Logger) *logger

func ParseLevel

func ParseLevel(levelString string) zap.AtomicLevel

Types

type IPArray added in v0.8.0

type IPArray []net.IP

func (IPArray) MarshalLogArray added in v0.8.0

func (ss IPArray) MarshalLogArray(arr zapcore.ArrayEncoder) error

type Logger

type Logger interface {
	Named(s string) Logger
	With(fields ...zap.Field) Logger
	Debug(msg string, fields ...zap.Field)
	Info(msg string, fields ...zap.Field)
	Warn(msg string, fields ...zap.Field)
	Error(msg string, fields ...zap.Field)
	Panic(msg string, fields ...zap.Field)
	Fatal(msg string, fields ...zap.Field)
	Sync() error
	ZapLogger() *zap.Logger
}

func CreateLogger

func CreateLogger() Logger

func CreateTestLogger added in v0.1.0

func CreateTestLogger(tb testing.TB) Logger

type LoggingOption added in v0.8.0

type LoggingOption interface {
	Apply(cfg *zap.Config)
}

func WithDevelopment added in v0.8.0

func WithDevelopment(developmentLogging bool) LoggingOption

func WithEncoding added in v0.8.0

func WithEncoding(encoding string) LoggingOption

func WithInitialFields added in v0.8.0

func WithInitialFields(initialFields map[string]interface{}) LoggingOption

func WithLevel added in v0.8.0

func WithLevel(level zap.AtomicLevel) LoggingOption

type LoggingOptionFunc added in v0.8.0

type LoggingOptionFunc func(cfg *zap.Config)

func (LoggingOptionFunc) Apply added in v0.8.0

func (f LoggingOptionFunc) Apply(cfg *zap.Config)

Jump to

Keyboard shortcuts

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