diff --git a/include/spdlog/async.h b/include/spdlog/async.h index f70c4a3e..b67c3329 100644 --- a/include/spdlog/async.h +++ b/include/spdlog/async.h @@ -42,7 +42,7 @@ struct async_factory_impl auto ®istry_inst = details::registry::instance(); // create global thread pool if not already exists.. - std::lock_guard(registry_inst.tp_mutex()); + std::lock_guard lock(registry_inst.tp_mutex()); auto tp = registry_inst.get_tp(); if (tp == nullptr) { diff --git a/include/spdlog/sinks/android_sink.h b/include/spdlog/sinks/android_sink.h index d6238600..fcb9ccbf 100644 --- a/include/spdlog/sinks/android_sink.h +++ b/include/spdlog/sinks/android_sink.h @@ -30,8 +30,8 @@ template class android_sink SPDLOG_FINAL : public base_sink { public: - explicit android_sink(const std::string &tag = "spdlog", bool use_raw_msg = false) - : tag_(tag) + explicit android_sink(std::string tag = "spdlog", bool use_raw_msg = false) + : tag_(std::move(tag)) , use_raw_msg_(use_raw_msg) { } diff --git a/include/spdlog/sinks/ansicolor_sink.h b/include/spdlog/sinks/ansicolor_sink.h index 3b79976d..4bd1c679 100644 --- a/include/spdlog/sinks/ansicolor_sink.h +++ b/include/spdlog/sinks/ansicolor_sink.h @@ -84,8 +84,7 @@ public: const std::string on_cyan = "\033[46m"; const std::string on_white = "\033[47m"; - void log(const details::log_msg &msg) SPDLOG_FINAL override - { + void log(const details::log_msg &msg) SPDLOG_FINAL { // Wrap the originally formatted message in color codes. // If color is not supported in the terminal, log as is instead. std::lock_guard lock(mutex_);