logging

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2019 License: MIT Imports: 4 Imported by: 0 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

View Source
var DefaultLogger = NewNopLogger()

DefaultLogger is the default logger.

Functions

This section is empty.

Types

type Field

type Field = zapcore.Field

Field is the logger field.

func Duration

func Duration(k string, d time.Duration) Field

Duration appends a duration field.

func Error

func Error(v error) Field

Error appends an error field.

func Float64

func Float64(key string, val float64) Field

Float64 appends a float64 field.

func Int

func Int(k string, i int) Field

Int appends an int field.

func Int64

func Int64(k string, i int64) Field

Int64 appends an int64 field.

func Object

func Object(key string, val zapcore.ObjectMarshaler) Field

Object appends an object field with implements ObjectMarshaler interface.

func String

func String(k, v string) Field

String appends a string field.

func Time

func Time(key string, val time.Time) Field

Time appends a time field.

type Logger

type Logger interface {
	Panic(context.Context, string, ...Field)
	Info(context.Context, string, ...Field)
	Error(context.Context, string, ...Field)
	Debug(context.Context, string, ...Field)
	Sync() error
	With(fields ...Field) Logger
}

Logger is the standart logger interface.

func NewDevelopmentLogger

func NewDevelopmentLogger() (Logger, error)

NewDevelopmentLogger initializes a development logger.

func NewNopLogger

func NewNopLogger() Logger

NewNopLogger initializes a noop logger.

func NewProductionLogger

func NewProductionLogger() (Logger, error)

NewProductionLogger initializes a production logger.

type ObjectEncoder

type ObjectEncoder = zapcore.ObjectEncoder

ObjectEncoder is the logger representation of a structure.

Jump to

Keyboard shortcuts

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