logging

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2023 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLogger

func GetLogger(c *Config) *zap.Logger

GetLogger returns the zap logger object. This can be used to customize the logger object.

func GetSugaredLogger

func GetSugaredLogger(c *Config) *zap.SugaredLogger

GetSugaredLogger returns the zap sugared logger which can be used to emit log messages from the app.

func GetSugaredLoggerForTest

func GetSugaredLoggerForTest() *zap.SugaredLogger

GetSugardLoggerForTest returns a generic zap sugared logger without configuration that should be used during testing. Namely, this initializes the logger to maximize logging output.

func GetSugaredLoggerWithoutConfig

func GetSugaredLoggerWithoutConfig() (*zap.SugaredLogger, error)

GetSugardLoggerWithoutConfig returns a generic zap sugared logger without configuration. This is useful for emitting log messages before the initialization stage.

func GetZapConfig

func GetZapConfig(c *Config) zap.Config

GetZapConfig returns the configuration for zap.

Types

type Config

type Config struct {
	Level          zap.AtomicLevel
	Encoding       string
	NoColor        bool
	WithStackTrace bool
}

func NewConfig

func NewConfig(lvl string) (*Config, error)

Jump to

Keyboard shortcuts

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