log

package
v1.15.1 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2019 License: Apache-2.0 Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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