Documentation
¶
Overview ¶
Package debug provides debug logging utilities for agnt.
Index ¶
- func Close()
- func Disable()
- func DumpToFile(prefix string) (string, error)
- func Enable()
- func Error(component, format string, args ...interface{})
- func GetLogFilePath() string
- func Info(component, format string, args ...interface{})
- func IsEnabled() bool
- func Log(component, format string, args ...interface{})
- func LogWithTimestamp(component, format string, args ...interface{})
- func SetLogFile(name string) error
- func Trace(component, format string, args ...interface{})
- func Warn(component, format string, args ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DumpToFile ¶
DumpToFile writes all buffered logs to a file for debugging. Returns the file path.
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 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 ¶
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.
Types ¶
This section is empty.