mirror of
https://github.com/gabime/spdlog.git
synced 2024-11-16 00:45:48 +08:00
astyle
This commit is contained in:
parent
365d895482
commit
295e189b7e
@ -125,9 +125,9 @@ private:
|
|||||||
|
|
||||||
// last exception thrown from the worker thread
|
// last exception thrown from the worker thread
|
||||||
std::shared_ptr<spdlog_ex> _last_workerthread_ex;
|
std::shared_ptr<spdlog_ex> _last_workerthread_ex;
|
||||||
|
|
||||||
// overflow policy
|
// overflow policy
|
||||||
const async_queue_overflow_policy _overflow_policy;
|
const async_queue_overflow_policy _overflow_policy;
|
||||||
|
|
||||||
// worker thread warmup callback - one can set thread priority, affinity, etc
|
// worker thread warmup callback - one can set thread priority, affinity, etc
|
||||||
const std::function<void()> _worker_warmup_cb;
|
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),
|
_formatter(formatter),
|
||||||
_sinks(sinks),
|
_sinks(sinks),
|
||||||
_q(queue_size),
|
_q(queue_size),
|
||||||
_overflow_policy(overflow_policy),
|
_overflow_policy(overflow_policy),
|
||||||
_worker_warmup_cb(worker_warmup_cb),
|
_worker_warmup_cb(worker_warmup_cb),
|
||||||
_worker_thread(&async_log_helper::worker_loop, this)
|
_worker_thread(&async_log_helper::worker_loop, this)
|
||||||
{}
|
{}
|
||||||
|
@ -125,8 +125,8 @@ public:
|
|||||||
std::lock_guard<std::mutex> lock(_mutex);
|
std::lock_guard<std::mutex> lock(_mutex);
|
||||||
_async_mode = true;
|
_async_mode = true;
|
||||||
_async_q_size = q_size;
|
_async_q_size = q_size;
|
||||||
_overflow_policy = overflow_policy;
|
_overflow_policy = overflow_policy;
|
||||||
_worker_warmup_cb = worker_warmup_cb;
|
_worker_warmup_cb = worker_warmup_cb;
|
||||||
}
|
}
|
||||||
|
|
||||||
void set_sync_mode()
|
void set_sync_mode()
|
||||||
@ -152,8 +152,8 @@ private:
|
|||||||
level::level_enum _level = level::info;
|
level::level_enum _level = level::info;
|
||||||
bool _async_mode = false;
|
bool _async_mode = false;
|
||||||
size_t _async_q_size = 0;
|
size_t _async_q_size = 0;
|
||||||
async_queue_overflow_policy _overflow_policy = async_queue_overflow_policy::block_retry;
|
async_queue_overflow_policy _overflow_policy = async_queue_overflow_policy::block_retry;
|
||||||
std::function<void()> _worker_warmup_cb = nullptr;
|
std::function<void()> _worker_warmup_cb = nullptr;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -61,9 +61,10 @@ void set_level(level::level_enum log_level);
|
|||||||
// Async mode - off by default.
|
// Async mode - off by default.
|
||||||
//
|
//
|
||||||
|
|
||||||
enum class async_queue_overflow_policy {
|
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
|
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
|
// Turn on async mode and set the queue size for each async_logger
|
||||||
|
Loading…
Reference in New Issue
Block a user