zaplogger

package
v1.0.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	LevelDebug = "debug"
	LevelInfo  = "info"
	LevelWarn  = "warn"
	LevelError = "error"
)
View Source
const (
	EncoderConsole = "console"
	EncoderJSON    = "json"
)
View Source
const (
	TimeEncoderISO8601 = "iso8601"
	TimeEncoderMillis  = "millis"
	TimeEncoderNanos   = "nano"
	TimeEncoderEpoch   = "epoch"
	TimeEncoderDefault = "default"
)

Variables

This section is empty.

Functions

func New

func New(name string) *zap.Logger

func NewConfig

func NewConfig(c ZapConfig) (*zapConfig, error)

func NewLogger

func NewLogger(c *zapConfig) *zap.Logger

func NewSugar

func NewSugar(name string) *zap.SugaredLogger

func Setup

func Setup()

Types

type ZapConfig

type ZapConfig struct {
	Development  bool   `json:"development,omitempty" yaml:"development,omitempty"`
	Encoder      string `json:"encoder,omitempty" yaml:"encoder,omitempty"`
	Level        string `json:"level,omitempty" yaml:"level,omitempty"`
	StackLevel   string `json:"stack_level,omitempty" yaml:"stack_level,omitempty"`
	Sample       bool   `json:"sample,omitempty" yaml:"sample,omitempty"`
	TimeEncoding string `json:"time_encoding,omitempty" yaml:"time_encoding,omitempty"`
}
var Config ZapConfig

Jump to

Keyboard shortcuts

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