mirror of
https://github.com/sipeed/picoclaw.git
synced 2026-06-12 18:08:54 +00:00
refactor: replace log.Printf/fmt.Printf with structured logger
Replace raw log.Printf and fmt.Printf calls in pkg/state, pkg/agent, and pkg/tools with structured logger calls (WarnCF/InfoCF). This ensures warnings and info messages are routed through the configured logging infrastructure instead of raw stderr/stdout.
This commit is contained in:
@@ -2,7 +2,6 @@ package agent
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
@@ -414,7 +413,10 @@ func compilePatterns(patterns []string) []*regexp.Regexp {
|
||||
for _, p := range patterns {
|
||||
re, err := regexp.Compile(p)
|
||||
if err != nil {
|
||||
fmt.Printf("Warning: invalid path pattern %q: %v\n", p, err)
|
||||
logger.WarnCF("agent", "invalid path pattern in compilePatterns", map[string]any{
|
||||
"pattern": p,
|
||||
"error": err.Error(),
|
||||
})
|
||||
continue
|
||||
}
|
||||
compiled = append(compiled, re)
|
||||
|
||||
Reference in New Issue
Block a user