tielog

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2026 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package tielog installs the process-wide slog logger used by tie-triplestore and tie-filehost. It fans every record out to two sinks at once: structured JSON appended to a log file (for machine parsing / retention) and a pretty, optionally colored line on stderr (for a human watching the console). stdout is never touched — it is reserved for data (e.g. dump TSV).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Setup

func Setup(cfg Config) (cleanup func(), err error)

Setup installs a slog default logger per cfg and returns a cleanup func that closes the log file (a no-op if none was opened). Call it once at startup; any error opening the file is returned but stderr logging is still installed.

Types

type Config

type Config struct {
	// File is the path to append JSON logs to. Empty disables file logging.
	File string
	// Level is the minimum level to emit ("debug", "info", "warn", "error").
	// Empty defaults to info.
	Level string
}

Config controls logger setup. The zero value is valid: no file, info level, pretty stderr.

Jump to

Keyboard shortcuts

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