Add verbose flag for debug output control
Introduces log.Debug() function that respects a Verbose config flag, replacing direct [debug] fmt.Fprintf calls throughout the codebase. This allows debug logging to be toggled via -v/--verbose CLI flag.
This commit is contained in:
@@ -11,6 +11,16 @@ import (
|
||||
// -----------------------------------------
|
||||
|
||||
var logFile *os.File
|
||||
var Verbose bool
|
||||
|
||||
// -----------------------------------------
|
||||
|
||||
func Debug(format string, args ...interface{}) {
|
||||
if !Verbose {
|
||||
return
|
||||
}
|
||||
fmt.Fprintf(os.Stderr, "[debug] "+format+"\n", args...)
|
||||
}
|
||||
|
||||
// -----------------------------------------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user