logger

package
v0.3.1 Latest Latest
Warning

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

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

Documentation

Overview

Package logger provides the single construction point for tailkitd's structured logger. Every other package receives a *zap.Logger as a constructor argument — this is the only file that calls zap.New*.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(env string) (*zap.Logger, error)

Build returns a *zap.Logger configured for the given environment.

  • "development": human-readable console output, DEBUG level and above, caller information included. Use when running tailkitd locally.
  • anything else (including ""): JSON output to stderr, INFO level and above. This is the production default.

The environment is typically sourced from the TAILKITD_ENV environment variable in main.go:

logger, err := logger.Build(os.Getenv("TAILKITD_ENV"))

func MustBuild

func MustBuild(env string) *zap.Logger

MustBuild is like Build but panics on error. Suitable for use in main() where a logger failure is unrecoverable.

Types

This section is empty.

Jump to

Keyboard shortcuts

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