davsclaus opened a new pull request, #29974:
URL: https://github.com/apache/camel/pull/29974

   _Claude Code on behalf of davsclaus_
   
   The Log tab did not follow after a while on another tab. It showed `● live` 
but played lines from up to a minute earlier for several seconds. This happened 
after browsing the Diagram and then opening the Log tab, and with `Space` when 
a pause was followed by a while on another tab.
   
   **Why.** The log file is only read while the Log tab is on screen, or the 
log is pinned (`CamelMonitor.refreshLogData`). Each refresh reads at most 64 
KB. A busy log grows well beyond that while another tab is shown: a demo that 
logs a WARN with a stack trace about once a second wrote 480 KB in a minute. 
Back on the Log tab, the reading went on from where it stopped, 64 KB at a 
refresh. The tab played the lines it had missed for about 8 seconds before it 
reached the present.
   
   **Fix.** In `LogTab.refreshFromFile`, while following, a log more than one 
read (64 KB) behind starts again at its end, as when the tab opens. The skipped 
lines are still there: `Home` reads them, as it reads older lines today. 
Paused, the tab reads on from where it was, so the lines on screen stay 
continuous.
   
   `refreshFromFile` now takes the path of the log, so a test can read a file 
of its own. The read cap is `MAX_READ_BYTES`.
   
   **Tests.**
   - `LogTabTailTest` has two new tests:
     - Following, a log that grew four reads' worth shows its newest line after 
one refresh, and `Home` still gets every line it skipped. This test fails 
without the fix.
     - Paused, the lines on screen stay and the log is read on a part at a time.
   - Checked live with that demo:
     - After a minute on the Diagram, the newest line on the Log tab was 
current within a second; before, it was about a minute old.
     - After a pause, a while on the Diagram and `Space`, it went straight to 
the present and kept up with the file.
   - The module's 2576 tests pass.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to