logger

package
v0.5.2 Latest Latest
Warning

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

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

Documentation

Overview

Package logger builds the project's standard zap logger.

The returned logger carries three fields every project tends to want in its aggregator: service (which service emitted the line), env (dev/prod/whatever), and commit (GIT_COMMIT from the build). Replace this file as your logging needs grow — the goal is one consistent shape across services, not a framework.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(service, env string) *zap.Logger

New returns a production zap logger tagged with the standard fields. Callers typically install it as the global so libraries can log via zap.L():

log := logger.New("api", "dev")
defer log.Sync()
zap.ReplaceGlobals(log)

Types

This section is empty.

Jump to

Keyboard shortcuts

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