debug

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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"

View Source
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

func Fatal(format string, args ...interface{}) error

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

func InitDebugLogFile() (string, error)

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

func SetDebugOutput(w io.Writer)

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.

Jump to

Keyboard shortcuts

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