feat: comprehensive debug logging across all controller modules
Add detailed [DEBUG] logging to every controller module when logging.level is set to "debug". Each module with stateful debug uses SetDebug(bool) wired from main.go. Covers stacks, backup, cloudflare, integrations, system, monitor, settings, scheduler, web handlers, storage, metrics, API, selfupdate, and assets. Also includes the app export/import (.fab bundles) feature from v0.32.0 and its debug page integration. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -11,6 +11,7 @@ import (
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"gitea.dooplex.hu/admin/felhom-controller/internal/util"
|
||||
)
|
||||
@@ -199,7 +200,7 @@ func partitionToParentDisk(devPath string) string {
|
||||
func enrichWithBlkid(disks []BlockDevice, logger *log.Logger, debug bool) {
|
||||
dbg := func(format string, args ...interface{}) {
|
||||
if debug && logger != nil {
|
||||
logger.Printf("[DEBUG] enrichWithBlkid: "+format, args...)
|
||||
logger.Printf("[DEBUG] [storage] enrichWithBlkid: "+format, args...)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -241,10 +242,13 @@ func enrichWithBlkid(disks []BlockDevice, logger *log.Logger, debug bool) {
|
||||
func ScanDisks(logger *log.Logger, debug bool) (*ScanResult, error) {
|
||||
dbg := func(format string, args ...interface{}) {
|
||||
if debug && logger != nil {
|
||||
logger.Printf("[DEBUG] ScanDisks: "+format, args...)
|
||||
logger.Printf("[DEBUG] [storage] ScanDisks: "+format, args...)
|
||||
}
|
||||
}
|
||||
|
||||
dbg("starting disk scan")
|
||||
scanStart := time.Now()
|
||||
|
||||
out, err := exec.Command(
|
||||
"lsblk", "-J", "-b",
|
||||
"-o", "NAME,PATH,SIZE,TYPE,FSTYPE,MOUNTPOINT,MODEL,RM",
|
||||
@@ -337,5 +341,7 @@ func ScanDisks(logger *log.Logger, debug bool) (*ScanResult, error) {
|
||||
enrichWithBlkid(result.AvailableDisks, logger, debug)
|
||||
enrichWithBlkid(result.SystemDisks, logger, debug)
|
||||
|
||||
dbg("disk scan completed in %s", time.Since(scanStart).Round(time.Millisecond))
|
||||
|
||||
return result, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user