logger

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLogger

func NewLogger(cfg *Config) (*zap.Logger, error)

Types

type Config

type Config struct {
	// Level specifies the minimum log level to output (debug, info, warn, error).
	Level string `yaml:"level"`

	// Encoding specifies the output format (json or console).
	Encoding string `yaml:"encoding"`

	// OutputPath specifies the path to the log file. If empty, logs are written to stdout.
	OutputPath string `yaml:"outputPath"`
}

Config holds the configuration for the logger. It allows customization of log level, output format, and destination.

func DefaultLoggerConfig

func DefaultLoggerConfig() *Config

defaultLoggerConfig returns a new Config with default settings. The log level is determined by the LOG_LEVEL environment variable, defaulting to "error" if not set. The encoding defaults to "console".

Jump to

Keyboard shortcuts

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