feat: comprehensive INFO/WARN/ERROR logging across all controller modules
Add structured operational logging at INFO, WARN, and ERROR levels to every controller module. Standardize custom prefixes ([GEO], [SCHED], [SYNC]) to use [INFO/WARN/ERROR] [module] format. Fix misleveled logs (WARN->ERROR for data loss scenarios, WARN->INFO for routine operations). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -27,6 +27,9 @@ func FormatAndMount(req FormatRequest, progress chan<- FormatProgress) (string,
|
||||
errStr = err.Error()
|
||||
}
|
||||
progress <- FormatProgress{Step: "error", Message: msg, Error: errStr, Percent: 0}
|
||||
if req.Logger != nil {
|
||||
req.Logger.Printf("[ERROR] [storage] Format failed: %v", err)
|
||||
}
|
||||
return fmt.Errorf("%s: %w", msg, err)
|
||||
}
|
||||
dbg := func(format string, args ...interface{}) {
|
||||
@@ -36,6 +39,9 @@ func FormatAndMount(req FormatRequest, progress chan<- FormatProgress) (string,
|
||||
}
|
||||
|
||||
mountPath := "/mnt/" + req.MountName
|
||||
if req.Logger != nil {
|
||||
req.Logger.Printf("[INFO] [storage] Formatting disk %s as ext4", req.DevicePath)
|
||||
}
|
||||
dbg("starting: device=%s mountName=%s createPartition=%v", req.DevicePath, req.MountName, req.CreatePartition)
|
||||
|
||||
// --- Step 1: Validate ---
|
||||
@@ -216,6 +222,9 @@ func FormatAndMount(req FormatRequest, progress chan<- FormatProgress) (string,
|
||||
}
|
||||
|
||||
dbg("format and mount completed successfully: %s", mountPath)
|
||||
if req.Logger != nil {
|
||||
req.Logger.Printf("[INFO] [storage] Disk formatted and mounted at %s", mountPath)
|
||||
}
|
||||
send("done", "Meghajtó sikeresen inicializálva: "+mountPath, 100)
|
||||
|
||||
return mountPath, nil
|
||||
|
||||
Reference in New Issue
Block a user