@@ -34,16 +34,16 @@ func runLogs(args []string) error {
3434 }
3535 defer f .Close ()
3636
37- // Collect all lines
3837 var lines []string
3938 scanner := bufio .NewScanner (f )
39+ // Increase scanner buffer for large log lines
40+ scanner .Buffer (make ([]byte , 0 , 1024 * 1024 ), 1024 * 1024 )
4041 for scanner .Scan () {
4142 if line := scanner .Text (); line != "" {
4243 lines = append (lines , line )
4344 }
4445 }
4546
46- // Take last N
4747 if len (lines ) > n {
4848 lines = lines [len (lines )- n :]
4949 }
@@ -53,51 +53,68 @@ func runLogs(args []string) error {
5353 return nil
5454 }
5555
56- fmt .Printf ("%-19s %-20s %-30s %-8s %s\n " , "TIME" , "PROJECT" , "RESULT" , "LATENCY" , "MSG/REG" )
57- fmt .Println (strings .Repeat ("─" , 88 ))
58-
5956 for _ , line := range lines {
6057 var e internal.LogEntry
6158 if err := json .Unmarshal ([]byte (line ), & e ); err != nil {
6259 continue
6360 }
6461
6562 ts , _ := time .Parse (time .RFC3339 , e .Timestamp )
66- local := ts .Local ().Format ("2006-01-02 15:04:05" )
63+ local := ts .Local ().Format ("15:04:05" )
6764
6865 project := filepath .Base (e .CWD )
69- if len (project ) > 20 {
70- project = project [:17 ] + "..."
66+ if len (project ) > 18 {
67+ project = project [:15 ] + "..."
68+ }
69+
70+ // Status indicator
71+ var status string
72+ switch e .Status {
73+ case "ok" :
74+ status = "✓"
75+ case "skipped" :
76+ status = "○"
77+ case "error" :
78+ status = "✗"
79+ default :
80+ status = "?"
7181 }
7282
73- result := "(nothing)"
83+ // Build result string
84+ var result string
7485 if e .Error != "" {
75- result = "error: " + truncate (e .Error , 28 )
86+ result = "error: " + truncate (e .Error , 50 )
87+ } else if e .SkipReason != "" {
88+ result = "skip: " + e .SkipReason
7689 } else if e .Result != nil {
7790 parts := []string {}
78- if len ( e .Result .Docs ) > 0 {
79- parts = append (parts , strings . Join ( shortPaths ( e . Result . Docs ), ", " ))
91+ for _ , d := range e .Result .Docs {
92+ parts = append (parts , filepath . Base ( d ))
8093 }
81- if len (e .Result .Skills ) > 0 {
82- for _ , s := range e .Result .Skills {
83- parts = append (parts , "/" + s )
84- }
94+ for _ , s := range e .Result .Skills {
95+ parts = append (parts , "/" + s )
8596 }
8697 if len (parts ) > 0 {
87- result = truncate (strings .Join (parts , " · " ), 30 )
98+ result = strings .Join (parts , ", " )
99+ } else {
100+ result = "(nothing needed)"
88101 }
102+ // Add reasoning if present
103+ if e .Result .Reasoning != "" {
104+ result += " — " + truncate (e .Result .Reasoning , 60 )
105+ }
106+ } else {
107+ result = "(nothing needed)"
89108 }
90109
91- excluded := len (e .Excluded .Docs ) + len (e .Excluded .Skills )
92- excludedStr := ""
93- if excluded > 0 {
94- excludedStr = fmt .Sprintf (" -%d" , excluded )
95- }
96- fmt .Printf ("%-19s %-20s %-30s %dms (%dm/%dr%s)\n " ,
97- local , project , result , e .LatencyMS , len (e .Messages ), len (e .Registry .Docs )+ len (e .Registry .Skills ), excludedStr )
110+ // Registry size
111+ regSize := len (e .Registry .Docs ) + len (e .Registry .Skills )
112+
113+ fmt .Printf (" %s %s %-18s %4dms %dm/%dr %s\n " ,
114+ status , local , project , e .LatencyMS , e .MessageCount , regSize , result )
98115 }
99116
100- fmt .Printf ("\n Log file: %s\n " , p )
117+ fmt .Printf ("\n %s\n " , p )
101118 return nil
102119}
103120
0 commit comments