mirror of
https://github.com/gabime/spdlog.git
synced 2025-10-02 03:19:02 +08:00
code formatting and clang tidy warnings fixes
This commit is contained in:
@@ -30,7 +30,7 @@ public:
|
||||
base_sink(const base_sink &) = delete;
|
||||
base_sink &operator=(const base_sink &) = delete;
|
||||
|
||||
void log(const details::log_msg &msg) SPDLOG_FINAL override
|
||||
void log(const details::log_msg &msg) SPDLOG_FINAL
|
||||
{
|
||||
std::lock_guard<Mutex> lock(mutex_);
|
||||
sink_it_(msg);
|
||||
|
@@ -20,7 +20,7 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
sink(std::unique_ptr<spdlog::pattern_formatter> formatter)
|
||||
explicit sink(std::unique_ptr<spdlog::pattern_formatter> formatter)
|
||||
: level_(level::trace)
|
||||
, formatter_(std::move(formatter)){};
|
||||
|
||||
|
@@ -19,7 +19,7 @@ namespace spdlog {
|
||||
namespace sinks {
|
||||
|
||||
template<typename TargetStream, typename ConsoleMutex>
|
||||
class stdout_sink : public sink
|
||||
class stdout_sink SPDLOG_FINAL : public sink
|
||||
{
|
||||
public:
|
||||
using mutex_t = typename ConsoleMutex::mutex_t;
|
||||
@@ -28,7 +28,7 @@ public:
|
||||
, file_(TargetStream::stream())
|
||||
{
|
||||
}
|
||||
~stdout_sink() = default;
|
||||
~stdout_sink() override = default;
|
||||
|
||||
stdout_sink(const stdout_sink &other) = delete;
|
||||
stdout_sink &operator=(const stdout_sink &other) = delete;
|
||||
@@ -48,13 +48,13 @@ public:
|
||||
fflush(file_);
|
||||
}
|
||||
|
||||
void set_pattern(const std::string &pattern) override SPDLOG_FINAL
|
||||
void set_pattern(const std::string &pattern) override
|
||||
{
|
||||
std::lock_guard<mutex_t> lock(mutex_);
|
||||
formatter_ = std::unique_ptr<spdlog::formatter>(new pattern_formatter(pattern));
|
||||
}
|
||||
|
||||
void set_formatter(std::unique_ptr<spdlog::formatter> sink_formatter) override SPDLOG_FINAL
|
||||
void set_formatter(std::unique_ptr<spdlog::formatter> sink_formatter) override
|
||||
{
|
||||
std::lock_guard<mutex_t> lock(mutex_);
|
||||
formatter_ = std::move(sink_formatter);
|
||||
|
@@ -24,8 +24,8 @@ class syslog_sink : public base_sink<Mutex>
|
||||
{
|
||||
public:
|
||||
//
|
||||
syslog_sink(const std::string &ident = "", int syslog_option = 0, int syslog_facility = LOG_USER)
|
||||
: ident_(ident)
|
||||
explicit syslog_sink(std::string ident = "", int syslog_option = 0, int syslog_facility = LOG_USER)
|
||||
: ident_(std::move(ident))
|
||||
{
|
||||
priorities_[static_cast<size_t>(level::trace)] = LOG_DEBUG;
|
||||
priorities_[static_cast<size_t>(level::debug)] = LOG_DEBUG;
|
||||
|
Reference in New Issue
Block a user