logging

package
v0.0.0-...-aa6cde0 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2026 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package logging provides file logging for reel CLI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultLogDir

func DefaultLogDir() string

DefaultLogDir returns the default log directory following XDG Base Directory Spec. Uses $XDG_STATE_HOME/reel/logs, defaulting to ~/.local/state/reel/logs.

Types

type Logger

type Logger struct {
	// contains filtered or unexported fields
}

Logger wraps the standard logger with level filtering and file output.

func Setup

func Setup(logDir string, verbose, noLog bool, cmdArgs []string) (*Logger, error)

Setup creates a new logger that writes to a timestamped log file. Returns nil if logging is disabled (noLog=true). cmdArgs should be os.Args to log the command that was run.

func (*Logger) Close

func (l *Logger) Close() error

Close closes the log file.

func (*Logger) Debug

func (l *Logger) Debug(format string, args ...any)

Debug logs a debug-level message (only if verbose mode is enabled).

func (*Logger) FilePath

func (l *Logger) FilePath() string

FilePath returns the path to the active log file.

func (*Logger) Info

func (l *Logger) Info(format string, args ...any)

Info logs an info-level message.

func (*Logger) Writer

func (l *Logger) Writer() io.Writer

Writer returns an io.Writer that writes to the log file. Useful for redirecting other loggers or capturing output.

Jump to

Keyboard shortcuts

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