Logger which writes asynchronously to file from multiple threads
To make a fast logger you need to 


minimise the use of mutexes.
detach the logging from the writing.
minimise copying
pre-alloc the buffers


no allocs during logging.

make a ring buffer


fixed number of logging
decide what should happen if its full
slightly slower using a dequeue with minimises allocs

use atomic indexes to the (ring) buffer


if your system if fully loaded, you have to log often use the cv or wait until the logger thread gets scheduled by the OS.
use the cv.notice_one where the index is updated if the front is sufficient in front of the back end.



So a few of the things that are issues


The logger_thread blocks further logging while it writes.
The write blocks other threads logging


Running into a mutex that is taken causes a task switch, typically  taking from 1000ns to 22000ns on a x86, nearer the lower if its started again on the same hardware thread.