logger

package module
v0.1.0 Latest Latest
Warning

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

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

README

⚙️ Fx Zap Logger Module

uber fx module for go.uber.org/zap logger

Installation

go get github.com/lEx0/fx-logger-module

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Module = fx.Options(

	fx.Provide(New),

	fx.Invoke(func(logger *zap.Logger, lifecycle fx.Lifecycle) {
		lifecycle.Append(fx.Hook{
			OnStop: func(ctx context.Context) error {
				return logger.Sync()
			},
		})
	}),
)

Module модуль логгера

Functions

func New

func New(options Options) (*zap.Logger, error)

Types

type Options

type Options struct {
	Severity string
	Encoder  string
}

Jump to

Keyboard shortcuts

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