logger_factory

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(cfg Config) (loggercontract.Logger, error)

New builds a Logger for the configured driver, constructing only the chosen one.

Types

type Config

type Config struct {
	Driver string     `mapstructure:"driver" validate:"required,oneof=zap noop"`
	Zap    zap.Config `mapstructure:"zap"`
}

Config selects the logger driver and nests each driver's own config. Only the selected driver's sub-config is read; the factory never restates a driver's fields. The mapstructure/validate tags let a service load it directly (alias it).

Jump to

Keyboard shortcuts

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