logx

package
v0.177.2 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package logx configures the process-wide structured logger (slog) for gofer. A single text handler on stderr is installed as the slog default so any package can log key lifecycle events via slog.Info/Warn/Error without threading a logger through every struct. stderr (not stdout) keeps logs out of the CLI's data output (job JSON, completion scripts, etc.).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigureFile

func ConfigureFile(o FileOptions) error

ConfigureFile adds a rotating JSONL sink while retaining the text stderr sink. Explicit paths fail startup when they cannot be opened; implicit defaults warn and continue with stderr only.

func Setup

func Setup()

Setup installs the default slog logger. The level comes from GOFER_LOG_LEVEL (debug | info | warn | error; default info); an unrecognised value falls back to info. Called once at process start (cmd/gofer/main).

func SilenceStderr

func SilenceStderr()

SilenceStderr drops the stderr text sink for the rest of the process: a later ConfigureFile keeps only its file sink, and until then the default logger discards everything. It is what `gofer tunnel forward --quiet` means: nothing on the terminal, the file log untouched.

Types

type FileOptions

type FileOptions struct {
	Path                              string
	MaxSizeMB, MaxAgeDays, MaxBackups int
	Explicit                          bool
	Component                         string
}

FileOptions describes a rotating JSONL sink for one process component.

Jump to

Keyboard shortcuts

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