spdlog
Loading...
Searching...
No Matches
backtracer-inl.h
Go to the documentation of this file.
1// Copyright(c) 2015-present, Gabi Melman & spdlog contributors.
2// Distributed under the MIT License (http://opensource.org/licenses/MIT)
3
4#pragma once
5
6#ifndef SPDLOG_HEADER_ONLY
8#endif
9namespace spdlog {
10namespace details {
17
19{
20 std::lock_guard<std::mutex> lock(other.mutex_);
21 enabled_ = other.enabled();
22 messages_ = std::move(other.messages_);
23}
24
26{
28 enabled_ = other.enabled();
29 messages_ = std::move(other.messages_);
30 return *this;
31}
32
39
45
50
56
57// pop all items in the q and apply the given fun on each of them.
59{
61 while (!messages_.empty())
62 {
63 auto &front_msg = messages_.front();
64 fun(front_msg);
65 messages_.pop_front();
66 }
67}
68} // namespace details
69} // namespace spdlog
void push_back(const log_msg &msg)
backtracer & operator=(backtracer other)
std::atomic< bool > enabled_
Definition backtracer.h:21
void foreach_pop(std::function< void(const details::log_msg &)> fun)
circular_q< log_msg_buffer > messages_
Definition backtracer.h:22
#define SPDLOG_NOEXCEPT
Definition common.h:53
#define SPDLOG_INLINE
Definition common.h:33
T load(T... args)
T make_shared(T... args)
Definition async.h:25
T store(T... args)