log

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServiceKey   = "service"
	ComponentKey = "component"
	ErrorKey     = "error"
)

Variables

View Source
var NewNopLogger = zap.NewNop

Functions

func Component

func Component(name string) zap.Field

func ErrorMsg

func ErrorMsg(err error) zap.Field

func Service

func Service(name string) zap.Field

func SyncOnClose

func SyncOnClose(g *run.Group, logger *Logger)

Types

type Logger

type Logger = zap.Logger

func DefaultLogger

func DefaultLogger() (*Logger, error)

func NewLogger

func NewLogger(o *Option, opts ...zap.Option) (*Logger, error)

type Option

type Option struct {
	LogLevel    string
	LogEncoding string
	Caller      bool
	Prod        bool
	// contains filtered or unexported fields
}

func (*Option) CreateLogger

func (opt *Option) CreateLogger(opts ...zap.Option) (*Logger, error)

func (*Option) GetLevel

func (opt *Option) GetLevel() zap.AtomicLevel

func (*Option) Register

func (opt *Option) Register(app *cobra.Command)

Jump to

Keyboard shortcuts

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