flogging

package
v0.0.0-...-95b87ed Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CONSOLE = iota
	JSON
	LOGFMT
)
View Source
const (
	DisabledLevel = zapcore.Level(math.MinInt8)

	PayloadLevel = zapcore.Level(zapcore.DebugLevel - 1)
)
View Source
const GRPCModuleID = "grpc"

Variables

This section is empty.

Functions

func ActivateSpec

func ActivateSpec(spec string)

func DefaultLevel

func DefaultLevel() string

func Init

func Init(config Config)

func InitBackend

func InitBackend(formatter logging.Formatter, output io.Writer)

func InitFromSpec

func InitFromSpec(spec string) string

func IsValidLevel

func IsValidLevel(level string) bool

func LoggerLevel

func LoggerLevel(loggerName string) string

func NameToLevel

func NameToLevel(level string) zapcore.Level

func NewGRPCLogger

func NewGRPCLogger(l *zap.Logger) *zapgrpc.Logger

func NewZapLogger

func NewZapLogger(core zapcore.Core, options ...zap.Option) *zap.Logger

func Reset

func Reset()

func SetFormat

func SetFormat(formatSpec string) logging.Formatter

func SetWriter

func SetWriter(w io.Writer) io.Writer

Types

type Config

type Config struct {
	Format string

	LogSpec string

	Writer io.Writer
}

type Core

type Core struct {
	zapcore.LevelEnabler
	Levels   *LoggerLevels
	Encoders map[Encoding]zapcore.Encoder
	Selector EncodingSelector
	Output   zapcore.WriteSyncer
	Observer Observer
}

func (*Core) Check

func (*Core) Sync

func (c *Core) Sync() error

func (*Core) With

func (c *Core) With(fields []zapcore.Field) zapcore.Core

func (*Core) Write

func (c *Core) Write(e zapcore.Entry, fields []zapcore.Field) error

type Encoding

type Encoding int8

type EncodingSelector

type EncodingSelector interface {
	Encoding() Encoding
}

type FabricLogger

type FabricLogger struct {
	// contains filtered or unexported fields
}

func MustGetLogger

func MustGetLogger(loggerName string) *FabricLogger

func NewFabricLogger

func NewFabricLogger(l *zap.Logger, options ...zap.Option) *FabricLogger

func (*FabricLogger) Critical

func (f *FabricLogger) Critical(args ...interface{})

func (*FabricLogger) Criticalf

func (f *FabricLogger) Criticalf(template string, args ...interface{})

func (*FabricLogger) DPanic

func (f *FabricLogger) DPanic(args ...interface{})

func (*FabricLogger) DPanicf

func (f *FabricLogger) DPanicf(template string, args ...interface{})

func (*FabricLogger) DPanicw

func (f *FabricLogger) DPanicw(msg string, kvPairs ...interface{})

func (*FabricLogger) Debug

func (f *FabricLogger) Debug(args ...interface{})

func (*FabricLogger) Debugf

func (f *FabricLogger) Debugf(template string, args ...interface{})

func (*FabricLogger) Debugw

func (f *FabricLogger) Debugw(msg string, kvPairs ...interface{})

func (*FabricLogger) Error

func (f *FabricLogger) Error(args ...interface{})

func (*FabricLogger) Errorf

func (f *FabricLogger) Errorf(template string, args ...interface{})

func (*FabricLogger) Errorw

func (f *FabricLogger) Errorw(msg string, kvPairs ...interface{})

func (*FabricLogger) Fatal

func (f *FabricLogger) Fatal(args ...interface{})

func (*FabricLogger) Fatalf

func (f *FabricLogger) Fatalf(template string, args ...interface{})

func (*FabricLogger) Fatalw

func (f *FabricLogger) Fatalw(msg string, kvPairs ...interface{})

func (*FabricLogger) Info

func (f *FabricLogger) Info(args ...interface{})

func (*FabricLogger) Infof

func (f *FabricLogger) Infof(template string, args ...interface{})

func (*FabricLogger) Infow

func (f *FabricLogger) Infow(msg string, kvPairs ...interface{})

func (*FabricLogger) IsEnabledFor

func (f *FabricLogger) IsEnabledFor(level zapcore.Level) bool

func (*FabricLogger) Named

func (f *FabricLogger) Named(name string) *FabricLogger

func (*FabricLogger) Notice

func (f *FabricLogger) Notice(args ...interface{})

func (*FabricLogger) Noticef

func (f *FabricLogger) Noticef(template string, args ...interface{})

func (*FabricLogger) Panic

func (f *FabricLogger) Panic(args ...interface{})

func (*FabricLogger) Panicf

func (f *FabricLogger) Panicf(template string, args ...interface{})

func (*FabricLogger) Panicw

func (f *FabricLogger) Panicw(msg string, kvPairs ...interface{})

func (*FabricLogger) Sync

func (f *FabricLogger) Sync() error

func (*FabricLogger) Warn

func (f *FabricLogger) Warn(args ...interface{})

func (*FabricLogger) Warnf

func (f *FabricLogger) Warnf(template string, args ...interface{})

func (*FabricLogger) Warning

func (f *FabricLogger) Warning(args ...interface{})

func (*FabricLogger) Warningf

func (f *FabricLogger) Warningf(template string, args ...interface{})

func (*FabricLogger) Warnw

func (f *FabricLogger) Warnw(msg string, kvPairs ...interface{})

func (*FabricLogger) With

func (f *FabricLogger) With(args ...interface{}) *FabricLogger

func (*FabricLogger) WithOptions

func (f *FabricLogger) WithOptions(opts ...zap.Option) *FabricLogger

func (*FabricLogger) Zap

func (f *FabricLogger) Zap() *zap.Logger

type Logger

type Logger interface {
	Critical(args ...interface{})
	Criticalf(format string, args ...interface{})
	Debug(args ...interface{})
	Debugf(format string, args ...interface{})
	Error(args ...interface{})
	Errorf(format string, args ...interface{})
	Fatal(args ...interface{})
	Fatalf(format string, args ...interface{})
	Info(args ...interface{})
	Infof(format string, args ...interface{})
	Notice(args ...interface{})
	Noticef(format string, args ...interface{})
	Panic(args ...interface{})
	Panicf(format string, args ...interface{})
	Warning(args ...interface{})
	Warningf(format string, args ...interface{})
}

type LoggerLevels

type LoggerLevels struct {
	// contains filtered or unexported fields
}

func (*LoggerLevels) ActivateSpec

func (l *LoggerLevels) ActivateSpec(spec string) error

func (*LoggerLevels) DefaultLevel

func (l *LoggerLevels) DefaultLevel() zapcore.Level

func (*LoggerLevels) Enabled

func (l *LoggerLevels) Enabled(lvl zapcore.Level) bool

func (*LoggerLevels) Level

func (l *LoggerLevels) Level(loggerName string) zapcore.Level

func (*LoggerLevels) Spec

func (l *LoggerLevels) Spec() string

type Logging

type Logging struct {
	*LoggerLevels
	// contains filtered or unexported fields
}
var Global *Logging

func New

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

func (*Logging) Apply

func (l *Logging) Apply(c Config) error

func (*Logging) Check

func (l *Logging) Check(e zapcore.Entry, ce *zapcore.CheckedEntry)

func (*Logging) Encoding

func (l *Logging) Encoding() Encoding

func (*Logging) Logger

func (l *Logging) Logger(name string) *FabricLogger

func (*Logging) SetFormat

func (l *Logging) SetFormat(format string) error

func (*Logging) SetObserver

func (l *Logging) SetObserver(observer Observer) Observer

func (*Logging) SetWriter

func (l *Logging) SetWriter(w io.Writer) io.Writer

func (*Logging) Sync

func (l *Logging) Sync() error

func (*Logging) Write

func (l *Logging) Write(b []byte) (int, error)

func (*Logging) WriteEntry

func (l *Logging) WriteEntry(e zapcore.Entry, fields []zapcore.Field)

func (*Logging) ZapLogger

func (l *Logging) ZapLogger(name string) *zap.Logger

type ModuleLevels

type ModuleLevels struct {
	// contains filtered or unexported fields
}

func (*ModuleLevels) ActivateSpec

func (m *ModuleLevels) ActivateSpec(spec string) error

func (*ModuleLevels) DefaultLevel

func (m *ModuleLevels) DefaultLevel() zapcore.Level

func (*ModuleLevels) Level

func (m *ModuleLevels) Level(loggerName string) zapcore.Level

func (*ModuleLevels) Spec

func (m *ModuleLevels) Spec() string

type Observer

type Observer interface {
	Check(e zapcore.Entry, ce *zapcore.CheckedEntry)
	WriteEntry(e zapcore.Entry, fields []zapcore.Field)
}

func SetObserver

func SetObserver(observer Observer) Observer

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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