Unexport package-internal symbols that have no external callers: - validation: ValidatePrefix, ValidatePrefixWithAllowed, ForUpdate, ForClose, ForDelete, ForReopen - debug: PrintNormal, PrintlnNormal - linear: IssuesQuery - timeparsing: IsCompactDuration, ParseNaturalLanguage - utils: FindMoleculesJSONLInDir, ParseIssueID - testutil/fixtures: XLargeFromJSONL - storage/sqlite: Snapshot type Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
58 lines
1.1 KiB
Go
58 lines
1.1 KiB
Go
package debug
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
)
|
|
|
|
var (
|
|
enabled = os.Getenv("BD_DEBUG") != ""
|
|
verboseMode = false
|
|
quietMode = false
|
|
)
|
|
|
|
func Enabled() bool {
|
|
return enabled || verboseMode
|
|
}
|
|
|
|
// SetVerbose enables verbose/debug output
|
|
func SetVerbose(verbose bool) {
|
|
verboseMode = verbose
|
|
}
|
|
|
|
// SetQuiet enables quiet mode (suppress non-essential output)
|
|
func SetQuiet(quiet bool) {
|
|
quietMode = quiet
|
|
}
|
|
|
|
// IsQuiet returns true if quiet mode is enabled
|
|
func IsQuiet() bool {
|
|
return quietMode
|
|
}
|
|
|
|
func Logf(format string, args ...interface{}) {
|
|
if enabled || verboseMode {
|
|
fmt.Fprintf(os.Stderr, format, args...)
|
|
}
|
|
}
|
|
|
|
func Printf(format string, args ...interface{}) {
|
|
if enabled || verboseMode {
|
|
fmt.Printf(format, args...)
|
|
}
|
|
}
|
|
|
|
// printNormal prints output unless quiet mode is enabled
|
|
// Use this for normal informational output that should be suppressed in quiet mode
|
|
func printNormal(format string, args ...interface{}) {
|
|
if !quietMode {
|
|
fmt.Printf(format, args...)
|
|
}
|
|
}
|
|
|
|
// printlnNormal prints a line unless quiet mode is enabled
|
|
func printlnNormal(args ...interface{}) {
|
|
if !quietMode {
|
|
fmt.Println(args...)
|
|
}
|
|
}
|