Skip to content

Commit 67a982b

Browse files
committed
🐛 feat: integrate audit logging in update discovery
Add audit logging for success and failure events in the trackUpdateResult function to enhance visibility into recovery operations. This includes logging the outcome of self-healing attempts, which aids in monitoring and debugging the system's update processes.
1 parent 9d1c37d commit 67a982b

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

cmd/vibeaura/update_discovery.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414
"strings"
1515
"time"
1616

17+
"github.com/nathfavour/vibeauracle/internal/audit"
1718
"github.com/nathfavour/vibeauracle/sys"
1819
"golang.org/x/mod/semver"
1920
)
@@ -403,9 +404,11 @@ func trackUpdateResult(success bool) {
403404
fmt.Println("\n✅ Recovery successful! Please restart your terminal.")
404405
cfg.Update.FailureCount = 0
405406
cm.Save(cfg)
407+
audit.LogSuccess(cfg.DataDir, audit.EventSelfHeal, "recovery", Version, Commit, "self-healing successful", map[string]interface{}{"method": recoveryMethod})
406408
os.Exit(0)
407409
} else {
408410
fmt.Printf("\n❌ Recovery failed: %v\n", err)
411+
audit.LogFailure(cfg.DataDir, audit.EventSelfHeal, "recovery", Version, Commit, "self-healing failed: "+err.Error(), map[string]interface{}{"method": recoveryMethod})
409412
if buildFromSource {
410413
fmt.Println("👉 Try running: go install github.com/nathfavour/vibeauracle/cmd/vibeaura@latest")
411414
} else {

0 commit comments

Comments
 (0)