zap

package module
v2.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2020 License: MIT Imports: 9 Imported by: 6

README

GoZix Zap

Dependencies

Configuration example

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

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

Built-in Tags

Symbol Value Description
core.TagFactory zap.core.factory Add an factory

Cores

Documentation

Index

Constants

View Source
const (
	// BundleName is default definition name.
	BundleName = "zap"

	// ArgCoreType is argument name.
	ArgCoreType = "zap.core.type"

	// TagCoreFactory is factory tag.
	TagCoreFactory = "zap.core.factory"

	// DefStreamCoreFactory is definition name.
	DefStreamCoreFactory = "zap.core.stream"
)

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) (err 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 CoreFactory

type CoreFactory = func(path string) (zapcore.Core, error)

CoreFactory is type alias of core.Factory.

Jump to

Keyboard shortcuts

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