logging

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package logging provides the single initialisation point for the application logger. Call Setup once from main() before any other log output is needed.

Routing by environment:

  • Development (or no POSTHOG_API_KEY): colour console writer to stdout.
  • Production (POSTHOG_API_KEY set): JSON lines to stdout for log aggregators + PostHog writer that forwards warn-and-above entries as "server.log" capture events.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Setup

func Setup(cfg *config.Config) (shutdown func())

Setup configures the global zerolog logger according to cfg and returns a shutdown function that flushes any buffered PostHog events. The caller must invoke the returned function before the process exits — typically via defer:

shutdown := logging.Setup(cfg)
defer shutdown()

Setup must be called exactly once, early in main(), before any goroutines start writing log entries.

Types

This section is empty.

Jump to

Keyboard shortcuts

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