diff --git a/include/spdlog/logger-inl.h b/include/spdlog/logger-inl.h index 2599e092..05788552 100644 --- a/include/spdlog/logger-inl.h +++ b/include/spdlog/logger-inl.h @@ -29,38 +29,8 @@ SPDLOG_INLINE logger::logger(logger &&other) noexcept , level_(other.level_.load(std::memory_order_relaxed)) , flush_level_(other.flush_level_.load(std::memory_order_relaxed)) , custom_err_handler_(std::move(other.custom_err_handler_)) - {} -SPDLOG_INLINE logger &logger::operator=(logger other) noexcept -{ - this->swap(other); - return *this; -} - -SPDLOG_INLINE void logger::swap(spdlog::logger &other) 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_); -} - -SPDLOG_INLINE void swap(logger &a, logger &b) -{ - a.swap(b); -} - SPDLOG_INLINE void logger::set_level(level::level_enum log_level) { level_.store(log_level); diff --git a/include/spdlog/logger.h b/include/spdlog/logger.h index bbd897e0..8f5716a5 100644 --- a/include/spdlog/logger.h +++ b/include/spdlog/logger.h @@ -70,12 +70,10 @@ public: : logger(std::move(name), sinks.begin(), sinks.end()) {} - virtual ~logger() = default; - logger(const logger &other) noexcept; logger(logger &&other) noexcept; - logger &operator=(logger other) noexcept; - void swap(spdlog::logger &other) noexcept; + + virtual ~logger() = default; // log functions template @@ -129,8 +127,7 @@ public: } } -#ifdef SPDLOG_EMIT_SOURCE_LOCATION - +#ifdef SPDLOG_USE_SOURCE_LOCATION template void trace(loc_with_fmt fmt, Args &&...args) { diff --git a/include/spdlog/spdlog.h b/include/spdlog/spdlog.h index 790652c5..8d12b687 100644 --- a/include/spdlog/spdlog.h +++ b/include/spdlog/spdlog.h @@ -155,7 +155,7 @@ void log(level::level_enum lvl, S fmt, Args &&...args) default_logger_raw()->log(lvl, fmt, std::forward(args)...); } -#ifdef SPDLOG_EMIT_SOURCE_LOCATION +#ifdef SPDLOG_USE_SOURCE_LOCATION template void trace(loc_with_fmt fmt, Args &&...args) {