|
5 | 5 | "fmt" |
6 | 6 | "os" |
7 | 7 | "path/filepath" |
8 | | - "regexp" |
9 | 8 | "sort" |
10 | 9 |
|
11 | 10 | "github.com/spf13/cobra" |
@@ -259,37 +258,3 @@ func init() { |
259 | 258 | trainingCmd.AddCommand(trainingAnalyzeCmd) |
260 | 259 | trainingCmd.AddCommand(trainingStatsCmd) |
261 | 260 | } |
262 | | - |
263 | | -// Helper for log analysis |
264 | | -func analyzeLogFile(logPath string) ([]string, error) { |
265 | | - data, err := os.ReadFile(logPath) |
266 | | - if err != nil { |
267 | | - return nil, err |
268 | | - } |
269 | | - |
270 | | - content := string(data) |
271 | | - var issues []string |
272 | | - |
273 | | - // Check for common error patterns |
274 | | - errorPatterns := []struct { |
275 | | - pattern string |
276 | | - message string |
277 | | - }{ |
278 | | - {`panic:`, "Panic detected"}, |
279 | | - {`fatal:`, "Fatal error"}, |
280 | | - {`error:.*not found`, "Resource not found error"}, |
281 | | - {`rate limit`, "Rate limiting hit"}, |
282 | | - {`context deadline exceeded`, "Timeout"}, |
283 | | - {`failed to compile`, "Compilation failure"}, |
284 | | - {`syntax error`, "Syntax error in generated code"}, |
285 | | - } |
286 | | - |
287 | | - for _, ep := range errorPatterns { |
288 | | - re := regexp.MustCompile(`(?i)` + ep.pattern) |
289 | | - if re.MatchString(content) { |
290 | | - issues = append(issues, ep.message) |
291 | | - } |
292 | | - } |
293 | | - |
294 | | - return issues, nil |
295 | | -} |
0 commit comments