88#endif
99
1010#include < iostream>
11- #include < boost/thread/shared_mutex.hpp>
12- #include < boost/thread/shared_lock_guard.hpp>
11+ #include < memory>
1312#include < network/logging/logging.hpp>
1413
1514namespace network {namespace logging {
@@ -32,23 +31,22 @@ namespace handler
3231namespace
3332{
3433// the log handler have to manage itself the thread safety on call
35- log_record_handler current_log_record_handler = handler::std_log_handler;
36- boost::upgrade_mutex mutex_log_handler; // we still need to not change the log handler concurrently
34+ static auto current_log_record_handler =std::make_shared<log_record_handler>( & handler::std_log_handler ) ;
35+
3736}
3837
3938
4039void set_log_record_handler ( log_record_handler handler )
4140{
42- boost::lock_guard<boost::upgrade_mutex>write_lock ( mutex_log_handler );
43- current_log_record_handler = handler;
41+ current_log_record_handler = std::make_shared<log_record_handler>( handler );
4442}
4543
4644void log (const log_record& log )
4745{
48- boost::shared_lock<boost::upgrade_mutex> read_lock ( mutex_log_handler ) ;
49- if (current_log_record_handler )
46+ auto log_handler = current_log_record_handler ;
47+ if (log_handler )
5048 {
51- current_log_record_handler ( log );
49+ (*log_handler) ( log );
5250 }
5351}
5452