mirror of
https://github.com/gabime/spdlog.git
synced 2025-10-02 03:19:02 +08:00
Fixed multiple clang-tidy warnings
This commit is contained in:
@@ -21,10 +21,10 @@ namespace spdlog {
|
||||
namespace cfg {
|
||||
|
||||
// search for SPDLOG_LEVEL= in the args and use it to init the levels
|
||||
void load_argv_levels(int args, char **argv)
|
||||
void load_argv_levels(int argc, const char **argv)
|
||||
{
|
||||
const std::string spdlog_level_prefix = "SPDLOG_LEVEL=";
|
||||
for (int i = 1; i < args; i++)
|
||||
for (int i = 1; i < argc; i++)
|
||||
{
|
||||
std::string arg = argv[i];
|
||||
if (arg.find(spdlog_level_prefix) == 0)
|
||||
@@ -36,5 +36,10 @@ void load_argv_levels(int args, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
void load_argv_levels(int argc, char **argv)
|
||||
{
|
||||
load_argv_levels(argc, const_cast<const char**>(argv));
|
||||
}
|
||||
|
||||
} // namespace cfg
|
||||
} // namespace spdlog
|
||||
|
@@ -30,7 +30,11 @@ public:
|
||||
~ansicolor_sink() override = default;
|
||||
|
||||
ansicolor_sink(const ansicolor_sink &other) = delete;
|
||||
ansicolor_sink(ansicolor_sink &&other) = delete;
|
||||
|
||||
ansicolor_sink &operator=(const ansicolor_sink &other) = delete;
|
||||
ansicolor_sink &operator=(ansicolor_sink &&other) = delete;
|
||||
|
||||
void set_color(level::level_enum color_level, string_view_t color);
|
||||
void set_color_mode(color_mode mode);
|
||||
bool should_color();
|
||||
|
@@ -21,8 +21,14 @@ class base_sink : public sink
|
||||
public:
|
||||
base_sink();
|
||||
explicit base_sink(std::unique_ptr<spdlog::formatter> formatter);
|
||||
~base_sink() override = default;
|
||||
|
||||
base_sink(const base_sink &) = delete;
|
||||
base_sink(base_sink &&) = delete;
|
||||
|
||||
base_sink &operator=(const base_sink &) = delete;
|
||||
base_sink &operator=(base_sink &&) = delete;
|
||||
|
||||
void log(const details::log_msg &msg) final;
|
||||
void flush() final;
|
||||
void set_pattern(const std::string &pattern) final;
|
||||
|
@@ -19,8 +19,12 @@ public:
|
||||
using mutex_t = typename ConsoleMutex::mutex_t;
|
||||
explicit stdout_sink_base(FILE *file);
|
||||
~stdout_sink_base() override = default;
|
||||
|
||||
stdout_sink_base(const stdout_sink_base &other) = delete;
|
||||
stdout_sink_base(stdout_sink_base &&other) = delete;
|
||||
|
||||
stdout_sink_base &operator=(const stdout_sink_base &other) = delete;
|
||||
stdout_sink_base &operator=(stdout_sink_base &&other) = delete;
|
||||
|
||||
void log(const details::log_msg &msg) override;
|
||||
void flush() override;
|
||||
|
Reference in New Issue
Block a user