log

package
v0.0.0-...-8c7d5b1 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package log provides logging directives.

Package log provides logging directives.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDefaultLogger

func NewDefaultLogger() (*zap.SugaredLogger, error)

NewDefaultLogger returns an opinionated, sugared logger.

func NewTestLogger

func NewTestLogger(t *testing.T) *zap.Logger

NewTestLogger returns a new logger for testing purposes. This logger is configured with the zap DevelopmentConfig and annotations are disabled.

Types

type Configuration

type Configuration struct {
	Level    string
	Fields   map[string]interface{}
	Encoding string
}

Configuration defines config parameters for building a Logger.

func (Configuration) NewLogger

func (cfg Configuration) NewLogger() (*zap.Logger, error)

NewLogger returns a new logger with a production-ready config.

type Logger

type Logger interface {
	Debug(...interface{})
	Debugf(string, ...interface{})
	Info(...interface{})
	Infof(string, ...interface{})
	Warn(...interface{})
	Warnf(string, ...interface{})
	Error(...interface{})
	Errorf(string, ...interface{})
}

Logger interface provides an abstraction over different loggers that can be used with the application.

Jump to

Keyboard shortcuts

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