The old logic cannot ensure the ordering of logs even if the number of internal builders are 1.
This PR calls the old one MultiLogger and introduces a new one called SingleLogger.
SingleLogger uses a queue of builder in addition to an internal builder.
The internal builder gets empty and the queue glows atomically.
The builders of the queue are written by a single dedicated thread, thus the ordering is maintained.
A test case is also provided.
@carbolymer @khibino This should fix #203.
The old logic cannot ensure the ordering of logs even if the number of internal builders are 1. This PR calls the old one
MultiLogger
and introduces a new one calledSingleLogger
.SingleLogger
uses a queue of builder in addition to an internal builder. The internal builder gets empty and the queue glows atomically. The builders of the queue are written by a single dedicated thread, thus the ordering is maintained. A test case is also provided.