diff options
| author | Jeff Carr <[email protected]> | 2025-08-16 16:23:08 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-08-16 21:50:40 -0500 |
| commit | edb3e23311b9cd667898e625b07f5dbeb43e30e3 (patch) | |
| tree | 53da542d42f7b763c92b5622e7968b854ccbf7a6 /getDrives.go | |
| parent | de6b45ced2fec64bdd4eb1c7d90c13251d394fe8 (diff) | |
fixes to test plugins by os.Exec()v0.0.2
Diffstat (limited to 'getDrives.go')
| -rw-r--r-- | getDrives.go | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/getDrives.go b/getDrives.go index 35e4f49..a818645 100644 --- a/getDrives.go +++ b/getDrives.go @@ -1,10 +1,11 @@ package main import ( - "fmt" "os" "path/filepath" "strings" + + "go.wit.com/log" ) type DevInfo struct { @@ -17,7 +18,7 @@ type DevInfo struct { func doDrives2() { parts, err := parseProcPartitions() if err != nil { - fmt.Fprintf(os.Stderr, "Error reading /proc/partitions: %v\n", err) + log.Printf("Error reading /proc/partitions: %v\n", err) os.Exit(1) } @@ -42,12 +43,14 @@ func doDrives2() { for _, info := range devs { devPath := "/dev/" + info.Name if info.IsRaw { - fmt.Printf("%-12s -> %-8s (raw)\n", devPath, info.Type) + s := log.Sprintf("%-12s -> %-8s (raw)", devPath, info.Type) + log.Info(s) + me.dd.AddText(s) } else { if info.Parent != "" { - fmt.Printf("%-12s -> partition of /dev/%s\n", devPath, info.Parent) + log.Printf("%-12s -> partition of /dev/%s\n", devPath, info.Parent) } else { - fmt.Printf("%-12s -> unknown (no parent found)\n", devPath) + log.Printf("%-12s -> unknown (no parent found)\n", devPath) } } } |
