Function swap

Synopsis

#include <include/spdlog/logger.h>

void swap(spdlog::logger &other) SPDLOG_NOEXCEPT

Description

No description yet.

Source

Lines 43-60 in include/spdlog/logger-inl.h. Line 75 in include/spdlog/logger.h.

SPDLOG_INLINE void logger::swap(spdlog::logger &other) SPDLOG_NOEXCEPT
{
    name_.swap(other.name_);
    sinks_.swap(other.sinks_);

    // swap level_
    auto other_level = other.level_.load();
    auto my_level = level_.exchange(other_level);
    other.level_.store(my_level);

    // swap flush level_
    other_level = other.flush_level_.load();
    my_level = flush_level_.exchange(other_level);
    other.flush_level_.store(my_level);

    custom_err_handler_.swap(other.custom_err_handler_);
    std::swap(tracer_, other.tracer_);
}





Add Discussion

Log in to comment