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 ¶
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.
Click to show internal directories.
Click to hide internal directories.