C++ threadsafe logger