debug

package
v0.13.34 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package debug provides debug logging utilities for agnt.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close()

Close closes the log file if open.

func Disable

func Disable()

Disable turns off debug logging.

func DumpToFile

func DumpToFile(prefix string) (string, error)

DumpToFile writes all buffered logs to a file for debugging. Returns the file path.

func Enable

func Enable()

Enable turns on debug logging.

func Error

func Error(component, format string, args ...interface{})

Error logs an error message (always logged, regardless of debug mode).

func GetLogFilePath

func GetLogFilePath() string

GetLogFilePath returns the current log file path, or empty if not set.

func Info

func Info(component, format string, args ...interface{})

Info logs an info message (always logged, regardless of debug mode).

func IsEnabled

func IsEnabled() bool

IsEnabled returns whether debug logging is enabled.

func Log

func Log(component, format string, args ...interface{})

Log logs a debug message if debug mode is enabled. Format: [DEBUG] [component] message

func LogWithTimestamp

func LogWithTimestamp(component, format string, args ...interface{})

LogWithTimestamp logs a debug message with a high-precision timestamp.

func SetLogFile

func SetLogFile(name string) error

SetLogFile sets an optional file to write debug logs to. If path is empty, logs go to stderr only. The file is created/appended to in the user's cache directory.

func Trace

func Trace(component, format string, args ...interface{})

Trace logs a detailed trace message (only when debug is enabled). Use for very verbose logging like individual function calls.

func Warn

func Warn(component, format string, args ...interface{})

Warn logs a warning message (always logged, regardless of debug mode).

Types

This section is empty.

Jump to

Keyboard shortcuts

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