feat(log): 全面重构日志系统,支持日志级别、去除ANSI乱码并抑制高频轮询

This commit is contained in:
yml2213
2026-09-18 15:04:38 +08:00
parent 20bde97d7a
commit ec76844da8
15 changed files with 415 additions and 100 deletions
@@ -4,10 +4,10 @@ import (
"context"
"errors"
"fmt"
"log"
"time"
"affiliate_dash/internal/model"
"affiliate_dash/internal/pkg/applog"
"affiliate_dash/internal/pkg/timeutil"
"gorm.io/gorm"
@@ -116,9 +116,9 @@ func (s *FulfillmentService) RunProcessingTimeoutMonitor(ctx context.Context, ti
for {
changed, err := s.MarkProcessingTimeouts(timeout, 50)
if err != nil {
log.Printf("[fulfillment] timeout scan error: %v", err)
applog.Errorf("[fulfillment] timeout scan error: %v", err)
} else if changed > 0 {
log.Printf("[fulfillment] timeout scan marked failed count=%d", changed)
applog.Warnf("[fulfillment] timeout scan marked failed count=%d", changed)
}
select {
case <-ctx.Done():