Warning, file /include/spdlog/details/backtracer.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004 #pragma once
0005
0006 #include <spdlog/details/circular_q.h>
0007 #include <spdlog/details/log_msg_buffer.h>
0008
0009 #include <atomic>
0010 #include <functional>
0011 #include <mutex>
0012
0013
0014
0015
0016 namespace spdlog {
0017 namespace details {
0018 class SPDLOG_API backtracer {
0019 mutable std::mutex mutex_;
0020 std::atomic<bool> enabled_{false};
0021 circular_q<log_msg_buffer> messages_;
0022
0023 public:
0024 backtracer() = default;
0025 backtracer(const backtracer &other);
0026
0027 backtracer(backtracer &&other) SPDLOG_NOEXCEPT;
0028 backtracer &operator=(backtracer other);
0029
0030 void enable(size_t size);
0031 void disable();
0032 bool enabled() const;
0033 void push_back(const log_msg &msg);
0034 bool empty() const;
0035
0036
0037 void foreach_pop(std::function<void(const details::log_msg &)> fun);
0038 };
0039
0040 }
0041 }
0042
0043 #ifdef SPDLOG_HEADER_ONLY
0044 #include "backtracer-inl.h"
0045 #endif