mirror of
https://github.com/gabime/spdlog.git
synced 2025-01-16 09:47:56 +00:00
Compare commits
4 Commits
83b9149930
...
3dedb52163
Author | SHA1 | Date | |
---|---|---|---|
|
3dedb52163 | ||
|
ad393b83a2 | ||
|
01dac453db | ||
|
03abdf49a0 |
@ -28,10 +28,11 @@ public:
|
||||
std::vector<details::log_msg_buffer> last_raw(size_t lim = 0)
|
||||
{
|
||||
std::lock_guard<Mutex> lock(base_sink<Mutex>::mutex_);
|
||||
auto n_items = lim > 0 ? (std::min)(lim, q_.size()) : q_.size();
|
||||
auto items_available = q_.size();
|
||||
auto n_items = lim > 0 ? (std::min)(lim, items_available) : items_available;
|
||||
std::vector<details::log_msg_buffer> ret;
|
||||
ret.reserve(n_items);
|
||||
for (size_t i = 0; i < n_items; i++)
|
||||
for (size_t i = (items_available - n_items); i < items_available; i++)
|
||||
{
|
||||
ret.push_back(q_.at(i));
|
||||
}
|
||||
@ -41,10 +42,11 @@ public:
|
||||
std::vector<std::string> last_formatted(size_t lim = 0)
|
||||
{
|
||||
std::lock_guard<Mutex> lock(base_sink<Mutex>::mutex_);
|
||||
auto n_items = lim > 0 ? (std::min)(lim, q_.size()) : q_.size();
|
||||
auto items_available = q_.size();
|
||||
auto n_items = lim > 0 ? (std::min)(lim, items_available) : items_available;
|
||||
std::vector<std::string> ret;
|
||||
ret.reserve(n_items);
|
||||
for (size_t i = 0; i < n_items; i++)
|
||||
for (size_t i = (items_available - n_items); i < items_available; i++)
|
||||
{
|
||||
memory_buf_t formatted;
|
||||
base_sink<Mutex>::formatter_->format(q_.at(i), formatted);
|
||||
|
Loading…
Reference in New Issue
Block a user