logger

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(cfg *Config) *zap.Logger

New creates and configure new zap logger. nolint: funlen

func ZapLevelConverter added in v0.1.5

func ZapLevelConverter(level Level) zapcore.Level

Types

type Config

type Config struct {
	Format string
	Level  Level
	Time   bool
	Out    zapcore.WriteSyncer
	Err    zapcore.WriteSyncer
}

Config contains params to setup logger.

type Formatter

type Formatter int

Formatter defines output formatter.

const (
	TextFormatter Formatter = iota
	JSONFormatter
)

Format of outputs.

func (Formatter) String

func (f Formatter) String() string

type Level

type Level int8

Level defines log levels.

const (
	LevelDebug Level = iota
	LevelInfo
	LevelWarn
	LevelError
	LevelFatal
	LevelPanic
)

Log levels.

func (Level) String

func (l Level) String() string

Jump to

Keyboard shortcuts

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