log

package
v0.0.0-...-be244c0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Factory

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

Factory is the default logging wrapper that can create logger instances either for a given Context or context-less.

func NewFactory

func NewFactory(logger *zap.Logger) Factory

NewFactory creates a new Factory.

func (Factory) Bg

func (b Factory) Bg() Logger

Bg creates a context-unaware logger.

func (Factory) For

func (b Factory) For(ctx context.Context) Logger

For returns a context-aware Logger. If the context contains an OpenTracing span, all logging calls are also echo-ed into the span.

func (Factory) With

func (b Factory) With(fields ...zapcore.Field) Factory

With creates a child logger, and optionally adds some context fields to that logger.

type Logger

type Logger interface {
	Info(msg string, fields ...zapcore.Field)
	Error(msg string, fields ...zapcore.Field)
	Fatal(msg string, fields ...zapcore.Field)
	With(fields ...zapcore.Field) Logger
}

Logger is a simplified abstraction of the zap.Logger

Jump to

Keyboard shortcuts

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