I have sprinkled diagnostic Serial.print statements throughout my code to produce a history of program flow I could use for understanding failures, finding bugs.
However, I assumed that I could just disconnect the Serial Monitor and all that text would just fall off the end of the buffer onto the floor, and when I reconnected the Serial Monitor I'd see whatever was still in the buffer. Apparently not so.
After some time, my program begins to misbehave. I now suspect that it only kept working properly until the transmit buffer got full.
However, it didn't entirely stop. Some functions still worked.
So, how does Serial.print behave when the buffer is full? It doesn't seem to just block and hang, because parts of my program keep running.
How can I get the effect I want, namely to keep a log of modest length that I can look at after I see a malfunction, without leaving Serial Monitor always connected?