Class backtracer

Synopsis

#include <include/spdlog/details/backtracer.h>

class SPDLOG_API backtracer

Description

No description yet.

Methods

backtracer overload
disable
enable
enabled
foreach_poppop all items in the q and apply the given fun on each of them.
operator=
push_back

Source

Lines 18-38 in include/spdlog/details/backtracer.h.

class SPDLOG_API backtracer
{
    mutable std::mutex mutex_;
    std::atomic<bool> enabled_{false};
    circular_q<log_msg_buffer> messages_;

public:
    backtracer() = default;
    backtracer(const backtracer &other);

    backtracer(backtracer &&other) SPDLOG_NOEXCEPT;
    backtracer &operator=(backtracer other);

    void enable(size_t size);
    void disable();
    bool enabled() const;
    void push_back(const log_msg &msg);

    // pop all items in the q and apply the given fun on each of them.
    void foreach_pop(std::function<void(const details::log_msg &)> fun);
};





Add Discussion

Log in to comment