logger

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package logger builds the application's structured zap logger from environment-driven configuration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(c Config) (*zap.SugaredLogger, error)

New constructs a sugared logger. Timestamps are always ISO8601. An invalid LogLevel is tolerated by defaulting to debug rather than failing; New returns an error only when the underlying encoder cannot be built.

Types

type Config

type Config struct {
	LogLevel      string `default:"debug" split_words:"false"`
	ProdLogFormat bool   `default:"false" split_words:"false"`
}

Config controls logger construction. LogLevel is a zap level name; an unparseable value falls back to debug. ProdLogFormat selects the production JSON encoder over the development console encoder.

Jump to

Keyboard shortcuts

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