Protect logging ring buffer against overruns
Protect logging ring buffer against overruns

Overflowing the logging ring buffer caused some messages to be lost
and others to be emitted several times which could make the logs very
difficult to understand.

Now when the ring buffer gets full, logging is stopped. Once the logger
thread has cleared sufficient amount of messages from the ring buffer,
the number of lost messages is emitted and logging continues.

Also double the ring buffer size to make overruns less likely to occur.

philippedeswert/dsme,spiiroin/dsme,philippedeswert/dsme,spiiroin/dsme,philippedeswert/dsme