logger

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

README

Logger with zap

Usage

var loggerConfig *logger.LoggerConfig

logger.MustGetLogger(loggerConfig)

logger.L().xxxx

logger.S().xxxx

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func L added in v0.2.1

func L() *zap.Logger

func MustGetLogger

func MustGetLogger(config *LoggerConfig) *zap.Logger

func S added in v0.2.3

func S() *zap.SugaredLogger

Types

type LoggerConfig

type LoggerConfig struct {
	// Format can be json or console
	Format      string `mapstructure:"format" json:"format" yaml:"format"`
	ServiceName string `mapstructure:"service-name" json:"serviceName" yaml:"service-name"`
	// Level, debug, info, warning, error
	Level         string `mapstructure:"level" json:"level" yaml:"level"`
	DisableCaller bool   `mapstructure:"disable-caller" json:"disableCaller" yaml:"disable-caller"`
	Development   bool   `mapstructure:"development" json:"development" yaml:"development"`
}

Jump to

Keyboard shortcuts

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