#include <boost/logging/format.hpp>
Performs all writes in a thread-safe manner. In other words, makes sure that all operator() calls of base_type are called in a thread-safe manner.
To transform a writer into thread-safe writer, simply surround the writer with ts_write:
Example:
// not thread-safe logger< gather::ostream_like::return_str<>, write_to_cout> g_l(); // thread-safe logger< gather::ostream_like::return_str<>, ts_write<write_to_cout> > g_l(); // not thread-safe logger< gather::ostream_like::return_cache_str<> , format_write< format_base, destination_base> > g_l(); // thread-safe logger< gather::ostream_like::return_cache_str<> , ts_write< format_write< format_base, destination_base > > > g_l();
Depending on your scenario, you could prefer on_dedicated_thread class.