zap

package module
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2019 License: MIT Imports: 7 Imported by: 2

README

GoZix Zap

Dependencies

Configuration example

time_encoder config can be ("iso8601", "millis", "nanos") and only for "console" and "json" encoding

{
  "zap": {
    "cores": [{
      "level": "debug",
      "encoding": "console",
      "time_encoder": "iso8601"
    }, {
      "level": "debug",
      "encoding": "json",
      "time_encoder": "millis"
    }, {
      "addr": "127.0.0.1:12001",
      "level": "debug",
      "encoding": "gelf"
    }],
    "caller": true,
    "fields": [{
      "key": "team",
      "value": "any team name"
    }, {
      "key": "service",
      "value": "any service name"
    }],
    "stacktrace": "error",
    "message_key": "message",
    "development": true
  }
}

Documentation

Index

Constants

View Source
const BundleName = "zap"

BundleName is default definition name.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bundle

type Bundle struct{}

Bundle implements the glue.Bundle interface.

func NewBundle

func NewBundle() *Bundle

NewBundle create bundle instance.

func (*Bundle) Build

func (b *Bundle) Build(builder *di.Builder) error

Build implements the glue.Bundle interface.

func (*Bundle) DependsOn

func (b *Bundle) DependsOn() []string

DependsOn implements the glue.DependsOn interface.

func (*Bundle) Name

func (b *Bundle) Name() string

Key implements the glue.Bundle interface.

type Logger

type Logger = zap.Logger

Logger is type alias of zap.Logger

Jump to

Keyboard shortcuts

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