M7: add verbose mode for debugging
Add -v/--verbose persistent flag that prints debug info to stderr: D-Bus connection status, token plugin directory discovery, unlock method sequencing with per-method success/failure, and full cryptsetup command lines including LD_LIBRARY_PATH. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
16
internal/verbose/verbose.go
Normal file
16
internal/verbose/verbose.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package verbose
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
)
|
||||
|
||||
// Enabled is set by the root command's --verbose flag.
|
||||
var Enabled bool
|
||||
|
||||
// Printf prints to stderr if verbose mode is enabled.
|
||||
func Printf(format string, args ...any) {
|
||||
if Enabled {
|
||||
fmt.Fprintf(os.Stderr, "arca: "+format+"\n", args...)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user