pub fn rotate_if_needed() -> boolExpand description
Check if log rotation is needed and perform it.
Returns true if rotation was triggered (i.e., entries exceeded MAX_LOG_ENTRIES).
In the in-memory case this resets the counter to simulate discarding old entries.
Callers that maintain their own log buffers should drain old entries when this
returns true.