1
0
mirror of https://github.com/gabime/spdlog.git synced 2025-03-31 18:32:40 +08:00

clang format

This commit is contained in:
gabime 2018-07-10 23:53:00 +03:00
parent d409e5367b
commit 16ee72da7c
8 changed files with 200 additions and 204 deletions

View File

@ -32,7 +32,6 @@ void bench_mt(int howmany, std::shared_ptr<spdlog::logger> log, int thread_count
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
int howmany = 1000000; int howmany = 1000000;
int queue_size = howmany + 2; int queue_size = howmany + 2;
int threads = 10; int threads = 10;

View File

@ -91,7 +91,6 @@ int main(int , char *[])
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }
void bench(int howmany, std::shared_ptr<spdlog::logger> log) void bench(int howmany, std::shared_ptr<spdlog::logger> log)
{ {
using namespace std::chrono; using namespace std::chrono;
@ -143,7 +142,4 @@ void bench_mt(int howmany, std::shared_ptr<spdlog::logger> log, int thread_count
auto avg = total_nanos / howmany; auto avg = total_nanos / howmany;
cout << format(avg) << " ns/call" << endl; cout << format(avg) << " ns/call" << endl;
} }

View File

@ -39,7 +39,9 @@ namespace spdlog {
// should only be moved in or out of the queue.. // should only be moved in or out of the queue..
async_msg(const async_msg &) = delete; async_msg(const async_msg &) = delete;
#if defined(_MSC_VER) && _MSC_VER <= 1800 // support for vs2013 move
// support for vs2013 move
#if defined(_MSC_VER) && _MSC_VER <= 1800
async_msg(async_msg &&other) SPDLOG_NOEXCEPT : msg_type(other.msg_type), async_msg(async_msg &&other) SPDLOG_NOEXCEPT : msg_type(other.msg_type),
level(other.level), level(other.level),
time(other.time), time(other.time),
@ -61,7 +63,7 @@ namespace spdlog {
worker_ptr = std::move(other.worker_ptr); worker_ptr = std::move(other.worker_ptr);
return *this; return *this;
} }
#else #else // (_MSC_VER) && _MSC_VER <= 1800
async_msg(async_msg &&other) = default; async_msg(async_msg &&other) = default;
async_msg &operator=(async_msg &&other) = default; async_msg &operator=(async_msg &&other) = default;
#endif #endif
@ -173,9 +175,7 @@ namespace spdlog {
void worker_loop_() void worker_loop_()
{ {
while (process_next_msg_()) while (process_next_msg_()) {};
{
};
} }
// process next message in the queue // process next message in the queue

View File

@ -101,7 +101,8 @@ private:
details::os::remove(target); details::os::remove(target);
if (details::os::rename(src, target) != 0) if (details::os::rename(src, target) != 0)
{ {
throw spdlog_ex("rotating_file_sink: failed renaming " + filename_to_str(src) + " to " + filename_to_str(target), errno); throw spdlog_ex(
"rotating_file_sink: failed renaming " + filename_to_str(src) + " to " + filename_to_str(target), errno);
} }
} }
} }