Enormous log files if you unplug the board

If you unplug the board while the serial monitor is running, then you will get a never-ending stream of IO exceptions, burning 100% CPU and filling your drive.

I left it in this state overnight and it wrote a 30 GB log file(!), filled my hard drive, which caused my text editor to overwrite my program with an empty file, caused Arduino to silently crash on startup, and killed my dog. These log files seem to persist forever until you delete them, so less technical users could be getting even more screwed by this.

At the very least, there should be a timeout that limits this console spam to once a second or so.

I found this year-old bug report about the problem: Google Code Archive - Long-term storage for Google Code Project Hosting.

Hmm - Yeah thankfully I have never done this but I can see myself doing it at some point.

Someone might take notice now it's been unearthed again.