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:
@@ -90,7 +90,7 @@ func (s *Syncer) Sync(ctx context.Context) error {
|
||||
s.mu.Unlock()
|
||||
}()
|
||||
|
||||
s.logger.Println("[INFO] Asset sync starting...")
|
||||
s.logger.Println("[INFO] [assets] Asset sync starting...")
|
||||
syncStart := time.Now()
|
||||
|
||||
if err := os.MkdirAll(s.assetsDir, 0755); err != nil {
|
||||
@@ -140,7 +140,7 @@ func (s *Syncer) Sync(ctx context.Context) error {
|
||||
s.dbg("file %s: downloading (%s, %d bytes)", entry.Filename, reason, entry.Size)
|
||||
dlStart := time.Now()
|
||||
if err := s.downloadFile(ctx, entry.Filename); err != nil {
|
||||
s.logger.Printf("[WARN] Failed to download asset %s: %v", entry.Filename, err)
|
||||
s.logger.Printf("[WARN] [assets] Failed to download asset %s: %v", entry.Filename, err)
|
||||
continue
|
||||
}
|
||||
s.dbg("file %s: downloaded in %s", entry.Filename, time.Since(dlStart).Round(time.Millisecond))
|
||||
@@ -154,7 +154,7 @@ func (s *Syncer) Sync(ctx context.Context) error {
|
||||
path := filepath.Join(s.assetsDir, name)
|
||||
s.dbg("removing stale file %s", name)
|
||||
if err := os.Remove(path); err != nil {
|
||||
s.logger.Printf("[WARN] Failed to remove stale asset %s: %v", name, err)
|
||||
s.logger.Printf("[WARN] [assets] Failed to remove stale asset %s: %v", name, err)
|
||||
} else {
|
||||
removed++
|
||||
}
|
||||
@@ -174,7 +174,7 @@ func (s *Syncer) Sync(ctx context.Context) error {
|
||||
}
|
||||
s.mu.Unlock()
|
||||
|
||||
s.logger.Printf("[INFO] Asset sync complete: %d downloaded, %d unchanged, %d removed (%d total files)",
|
||||
s.logger.Printf("[INFO] [assets] Asset sync complete: %d downloaded, %d unchanged, %d removed (%d total files)",
|
||||
downloaded, skipped, removed, len(manifest.Files))
|
||||
s.dbg("sync completed in %s", time.Since(syncStart).Round(time.Millisecond))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user