fix: standardize log prefixes, remove duplicates, add missing module tags
Second-pass logging cleanup: consistent [LEVEL] [module] format across all 41 files. Remove stale prefixes ([CF], [SYNC], [SCHED], [API], [STORAGE], [HEALTH], [ROLLBACK]). Remove 5 duplicate log lines. Gate ungated DEBUG lines. Fix wrong log levels (restore start WARN→INFO). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -373,7 +373,7 @@ func (o *MigrateOrchestrator) RunEnhancedMigration(
|
||||
// to the same drive the app now lives on — no redundancy, so we clear it.
|
||||
if strings.HasPrefix(cfg.DestinationPath, req.TargetPath) || cfg.DestinationPath == req.TargetPath {
|
||||
tier2WillClear = true
|
||||
o.Logger.Printf("[INFO] Migration %s: Tier 2 will be cleared (dest %s is under target %s)",
|
||||
o.Logger.Printf("[INFO] [storage] Migration %s: Tier 2 will be cleared (dest %s is under target %s)",
|
||||
req.StackName, cfg.DestinationPath, req.TargetPath)
|
||||
}
|
||||
}
|
||||
@@ -408,13 +408,13 @@ func (o *MigrateOrchestrator) RunEnhancedMigration(
|
||||
dstDBDumps := backup.AppDBDumpPath(req.TargetPath, req.StackName)
|
||||
if _, err := os.Stat(srcDBDumps); err == nil {
|
||||
if err := os.MkdirAll(filepath.Dir(dstDBDumps), 0755); err != nil {
|
||||
o.Logger.Printf("[WARN] Migration %s: failed to create DB dump dir: %v", req.StackName, err)
|
||||
o.Logger.Printf("[WARN] [storage] Migration %s: failed to create DB dump dir: %v", req.StackName, err)
|
||||
} else {
|
||||
cmd := exec.Command("rsync", "-a", srcDBDumps+"/", dstDBDumps+"/")
|
||||
if out, err := cmd.CombinedOutput(); err != nil {
|
||||
o.Logger.Printf("[WARN] Migration %s: DB dump copy failed: %v — %s", req.StackName, err, string(out))
|
||||
o.Logger.Printf("[WARN] [storage] Migration %s: DB dump copy failed: %v — %s", req.StackName, err, string(out))
|
||||
} else {
|
||||
o.Logger.Printf("[INFO] Migration %s: DB dumps copied to %s", req.StackName, dstDBDumps)
|
||||
o.Logger.Printf("[INFO] [storage] Migration %s: DB dumps copied to %s", req.StackName, dstDBDumps)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -422,9 +422,9 @@ func (o *MigrateOrchestrator) RunEnhancedMigration(
|
||||
// 2. Clear Tier 2 if conflict
|
||||
if tier2WillClear {
|
||||
if err := o.Sett.SetCrossDriveConfig(req.StackName, nil); err != nil {
|
||||
o.Logger.Printf("[WARN] Migration %s: failed to clear Tier 2 config: %v", req.StackName, err)
|
||||
o.Logger.Printf("[WARN] [storage] Migration %s: failed to clear Tier 2 config: %v", req.StackName, err)
|
||||
} else {
|
||||
o.Logger.Printf("[INFO] Migration %s: Tier 2 cross-drive config cleared (dest was on same drive)", req.StackName)
|
||||
o.Logger.Printf("[INFO] [storage] Migration %s: Tier 2 cross-drive config cleared (dest was on same drive)", req.StackName)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -443,18 +443,18 @@ func (o *MigrateOrchestrator) RunEnhancedMigration(
|
||||
continue
|
||||
}
|
||||
if err := os.RemoveAll(srcPath); err != nil {
|
||||
o.Logger.Printf("[WARN] Migration %s: failed to delete stale data %s: %v", req.StackName, srcPath, err)
|
||||
o.Logger.Printf("[WARN] [storage] Migration %s: failed to delete stale data %s: %v", req.StackName, srcPath, err)
|
||||
} else {
|
||||
o.Logger.Printf("[INFO] Migration %s: deleted stale data %s", req.StackName, srcPath)
|
||||
o.Logger.Printf("[INFO] [storage] Migration %s: deleted stale data %s", req.StackName, srcPath)
|
||||
}
|
||||
}
|
||||
|
||||
// Delete DB dumps from source
|
||||
if _, err := os.Stat(srcDBDumps); err == nil {
|
||||
if err := os.RemoveAll(srcDBDumps); err != nil {
|
||||
o.Logger.Printf("[WARN] Migration %s: failed to delete stale DB dumps %s: %v", req.StackName, srcDBDumps, err)
|
||||
o.Logger.Printf("[WARN] [storage] Migration %s: failed to delete stale DB dumps %s: %v", req.StackName, srcDBDumps, err)
|
||||
} else {
|
||||
o.Logger.Printf("[INFO] Migration %s: deleted stale DB dumps %s", req.StackName, srcDBDumps)
|
||||
o.Logger.Printf("[INFO] [storage] Migration %s: deleted stale DB dumps %s", req.StackName, srcDBDumps)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -469,7 +469,7 @@ func (o *MigrateOrchestrator) RunEnhancedMigration(
|
||||
}
|
||||
|
||||
if err := o.BackupTrigger.TryRunDriveBackup(context.Background(), req.TargetPath); err != nil {
|
||||
o.Logger.Printf("[WARN] Migration %s: post-migration backup failed: %v", req.StackName, err)
|
||||
o.Logger.Printf("[WARN] [storage] Migration %s: post-migration backup failed: %v", req.StackName, err)
|
||||
progress <- MigrateProgress{
|
||||
Step: "backing_up",
|
||||
Message: "Biztonsági mentés nem indítható (másik mentés fut)",
|
||||
@@ -477,7 +477,7 @@ func (o *MigrateOrchestrator) RunEnhancedMigration(
|
||||
ElapsedSeconds: int(time.Since(start).Seconds()),
|
||||
}
|
||||
} else {
|
||||
o.Logger.Printf("[INFO] Migration %s: post-migration backup completed for %s", req.StackName, req.TargetPath)
|
||||
o.Logger.Printf("[INFO] [storage] Migration %s: post-migration backup completed for %s", req.StackName, req.TargetPath)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user