Documentation
¶
Index ¶
- Variables
- func CatastrophicError(format string, args ...interface{})
- func CloseDebugLog() error
- func Fatal(format string, args ...interface{}) error
- func FatalAndExit(format string, args ...interface{})
- func InitDebugLogFile() (string, error)
- func IsDebugEnabled() bool
- func Log(component, format string, args ...interface{})
- func LogIndexing(format string, args ...interface{})
- func LogMCP(format string, args ...interface{})
- func LogSearch(format string, args ...interface{})
- func Printf(format string, args ...interface{})
- func Println(args ...interface{})
- func SetDebugOutput(w io.Writer)
- func SetMCPMode(enabled bool)
Constants ¶
This section is empty.
Variables ¶
var EnableDebug = "false"
Build flag for debug mode - can be overridden at build time go build -ldflags "-X github.com/standardbeagle/lci/internal/debug.EnableDebug=true"
var MCPMode = false
MCPMode tracks if we're running in MCP mode (set by main)
Functions ¶
func CatastrophicError ¶
func CatastrophicError(format string, args ...interface{})
CatastrophicError outputs an error that indicates system failure to the debug log. In MCP mode, this is suppressed to maintain protocol compliance.
func CloseDebugLog ¶
func CloseDebugLog() error
CloseDebugLog closes the debug log file if one is open.
func Fatal ¶
Fatal outputs a catastrophic error message to the debug log and returns a fatal error. This function no longer calls os.Exit - callers should handle the error appropriately. In MCP mode, output is suppressed entirely.
func FatalAndExit ¶
func FatalAndExit(format string, args ...interface{})
FatalAndExit outputs a catastrophic error message and exits (for CLI use only). This should only be used in main.go or other CLI entry points. Output goes to the debug log file, not stderr.
func InitDebugLogFile ¶
InitDebugLogFile initializes debug logging to a file. Returns the path to the log file, or an error if initialization fails. Call CloseDebugLog when done to ensure the file is properly closed.
func IsDebugEnabled ¶
func IsDebugEnabled() bool
IsDebugEnabled returns true if debug mode is enabled and we're not in MCP mode
func Log ¶
func Log(component, format string, args ...interface{})
Log provides structured debug logging with component names
func LogIndexing ¶
func LogIndexing(format string, args ...interface{})
LogIndexing provides debug logging specifically for indexing operations
func LogMCP ¶
func LogMCP(format string, args ...interface{})
LogMCP provides debug logging specifically for MCP operations
func LogSearch ¶
func LogSearch(format string, args ...interface{})
LogSearch provides debug logging specifically for search operations
func Printf ¶
func Printf(format string, args ...interface{})
Printf prints debug information only when debug mode is enabled and output is configured
func Println ¶
func Println(args ...interface{})
Println prints debug information only when debug mode is enabled and output is configured
func SetDebugOutput ¶
SetDebugOutput sets a custom writer for debug output. Pass nil to disable debug output entirely.
func SetMCPMode ¶
func SetMCPMode(enabled bool)
SetMCPMode enables MCP mode which suppresses all debug output to stdio
Types ¶
This section is empty.