logging

package
v1.0.41 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2026 License: MIT Imports: 11 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 logging provides structured logging utilities for Aviary.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnableConsole

func EnableConsole()

EnableConsole mirrors slog + stdlib logs to stderr in addition to the log file. This is intended for the foreground server command, not short-lived CLI commands.

func Init

func Init() error

Init configures global slog + stdlib log output to write to Aviary's log file. Console logging is disabled by default and can be enabled explicitly for long-running server processes.

func InitMemory added in v0.7.27

func InitMemory() error

InitMemory configures global slog + stdlib log output like Init, but keeps the latest output in memory instead of a file, for processes such as `aviary watch` whose data directory is removed when they exit: no log file holds that directory open. Whichever of Init and InitMemory runs first wins.

func LogDir

func LogDir() string

LogDir returns Aviary's log directory.

func LogFilePath

func LogFilePath() string

LogFilePath returns the primary structured log file.

func MemoryLog added in v0.7.27

func MemoryLog() (data []byte, end int64, ok bool)

MemoryLog returns the output InitMemory has kept and the total number of bytes ever written, so data covers the bytes [end-len(data), end). ok is false when logs go to the log file instead.

func Shutdown

func Shutdown()

Shutdown closes any open log file and resets logging state. This is intended for use in tests so temporary log files can be removed.

Types

This section is empty.

Jump to

Keyboard shortcuts

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