logger

package
v0.2.5 Latest Latest
Warning

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

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

Documentation

Overview

Package logger provides dual-output structured logging.

Terminal output is human-readable with colors. File output is structured JSON written to <sharedDir>/.beamdrop/beamdrop.log.

Call Init() early in main to configure the default slog logger. All other packages should use slog.Info/Debug/Warn/Error directly. This package also provides a Fatal helper (slog has no Fatal).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close()

Close closes the log file. Call this on shutdown if desired.

func Fatal

func Fatal(msg string, args ...any)

Fatal logs at error level and exits the process. slog does not provide a Fatal level, so this is a convenience wrapper.

func Init

func Init(level, sharedDir string)

Init configures the default slog logger with dual output.

level:    "debug" | "info" | "warn" | "error" (default "info")
sharedDir: directory where .beamdrop/beamdrop.log will be written (empty = no file logging)

func LogPath

func LogPath() string

LogPath returns the path to the JSON log file, or "" if file logging is not active.

Types

This section is empty.

Jump to

Keyboard shortcuts

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