Commit 295e189b authored by Denis Ivaykin's avatar Denis Ivaykin

astyle

parent 365d8954
......@@ -125,9 +125,9 @@ private:
// last exception thrown from the worker thread
std::shared_ptr<spdlog_ex> _last_workerthread_ex;
// overflow policy
const async_queue_overflow_policy _overflow_policy;
// overflow policy
const async_queue_overflow_policy _overflow_policy;
// worker thread warmup callback - one can set thread priority, affinity, etc
const std::function<void()> _worker_warmup_cb;
......@@ -157,7 +157,7 @@ inline spdlog::details::async_log_helper::async_log_helper(formatter_ptr formatt
_formatter(formatter),
_sinks(sinks),
_q(queue_size),
_overflow_policy(overflow_policy),
_overflow_policy(overflow_policy),
_worker_warmup_cb(worker_warmup_cb),
_worker_thread(&async_log_helper::worker_loop, this)
{}
......
......@@ -125,8 +125,8 @@ public:
std::lock_guard<std::mutex> lock(_mutex);
_async_mode = true;
_async_q_size = q_size;
_overflow_policy = overflow_policy;
_worker_warmup_cb = worker_warmup_cb;
_overflow_policy = overflow_policy;
_worker_warmup_cb = worker_warmup_cb;
}
void set_sync_mode()
......@@ -152,8 +152,8 @@ private:
level::level_enum _level = level::info;
bool _async_mode = false;
size_t _async_q_size = 0;
async_queue_overflow_policy _overflow_policy = async_queue_overflow_policy::block_retry;
std::function<void()> _worker_warmup_cb = nullptr;
async_queue_overflow_policy _overflow_policy = async_queue_overflow_policy::block_retry;
std::function<void()> _worker_warmup_cb = nullptr;
};
}
}
......@@ -61,9 +61,10 @@ void set_level(level::level_enum log_level);
// Async mode - off by default.
//
enum class async_queue_overflow_policy {
block_retry, // Block / yield / sleep until message can be enqueued
discard_log_msg // Discard the message it enqueue fails
enum class async_queue_overflow_policy
{
block_retry, // Block / yield / sleep until message can be enqueued
discard_log_msg // Discard the message it enqueue fails
};
// Turn on async mode and set the queue size for each async_logger
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment