Skip to content

Commit

Permalink
modify spdlog
Browse files Browse the repository at this point in the history
  • Loading branch information
xcyle-gh committed Jan 10, 2017
1 parent 16c6997 commit fd1bf27
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
12 changes: 0 additions & 12 deletions Include/spdlog/details/async_log_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -229,8 +229,6 @@ inline spdlog::details::async_log_helper::~async_log_helper()
inline void spdlog::details::async_log_helper::log(const details::log_msg& msg)
{
push_msg(async_msg(msg));


}

inline void spdlog::details::async_log_helper::push_msg(details::async_log_helper::async_msg&& new_msg)
Expand All @@ -246,7 +244,6 @@ inline void spdlog::details::async_log_helper::push_msg(details::async_log_helpe
}
while (!_q.enqueue(std::move(new_msg)));
}

}

// optionally wait for the queue be empty and request flush from the sinks
Expand Down Expand Up @@ -281,10 +278,8 @@ inline void spdlog::details::async_log_helper::worker_loop()
// return true if this thread should still be active (while no terminate msg was received)
inline bool spdlog::details::async_log_helper::process_next_msg(log_clock::time_point& last_pop, log_clock::time_point& last_flush)
{

async_msg incoming_async_msg;


if (_q.dequeue(incoming_async_msg))
{
last_pop = details::os::now();
Expand Down Expand Up @@ -361,7 +356,6 @@ inline void spdlog::details::async_log_helper::sleep_or_yield(const spdlog::log_
if (time_since_op <= microseconds(100))
return std::this_thread::yield();


// sleep for 20 ms upto 200 ms
if (time_since_op <= milliseconds(200))
return sleep_for(milliseconds(20));
Expand All @@ -378,13 +372,7 @@ inline void spdlog::details::async_log_helper::wait_empty_q()
{
sleep_or_yield(details::os::now(), last_op);
}

}








2 changes: 1 addition & 1 deletion Include/spdlog/sinks/null_sink.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class null_sink : public base_sink < Mutex >

};
typedef null_sink<details::null_mutex> null_sink_st;
typedef null_sink<std::mutex> null_sink_mt;
typedef null_sink<details::null_mutex> null_sink_mt;

}
}
Expand Down

0 comments on commit fd1bf27

Please sign in to comment.