mirror of
https://github.com/gabime/spdlog.git
synced 2025-01-12 08:50:26 +08:00
code formatting and clang tidy warnings fixes
This commit is contained in:
parent
05d6960ebc
commit
6ae240c0b6
@ -24,7 +24,7 @@ namespace sinks {
|
|||||||
* If no color terminal detected, omit the escape codes.
|
* If no color terminal detected, omit the escape codes.
|
||||||
*/
|
*/
|
||||||
template<typename TargetStream, class ConsoleMutex>
|
template<typename TargetStream, class ConsoleMutex>
|
||||||
class ansicolor_sink : public sink
|
class ansicolor_sink SPDLOG_FINAL : public sink
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
using mutex_t = typename ConsoleMutex::mutex_t;
|
using mutex_t = typename ConsoleMutex::mutex_t;
|
||||||
@ -84,7 +84,7 @@ public:
|
|||||||
const std::string on_cyan = "\033[46m";
|
const std::string on_cyan = "\033[46m";
|
||||||
const std::string on_white = "\033[47m";
|
const std::string on_white = "\033[47m";
|
||||||
|
|
||||||
void log(const details::log_msg &msg) SPDLOG_FINAL override
|
void log(const details::log_msg &msg) override
|
||||||
{
|
{
|
||||||
// Wrap the originally formatted message in color codes.
|
// Wrap the originally formatted message in color codes.
|
||||||
// If color is not supported in the terminal, log as is instead.
|
// If color is not supported in the terminal, log as is instead.
|
||||||
@ -110,19 +110,19 @@ public:
|
|||||||
fflush(target_file_);
|
fflush(target_file_);
|
||||||
}
|
}
|
||||||
|
|
||||||
void flush() SPDLOG_FINAL override
|
void flush() override
|
||||||
{
|
{
|
||||||
std::lock_guard<mutex_t> lock(mutex_);
|
std::lock_guard<mutex_t> lock(mutex_);
|
||||||
fflush(target_file_);
|
fflush(target_file_);
|
||||||
}
|
}
|
||||||
|
|
||||||
void set_pattern(const std::string &pattern) override SPDLOG_FINAL
|
void set_pattern(const std::string &pattern) SPDLOG_FINAL
|
||||||
{
|
{
|
||||||
std::lock_guard<mutex_t> lock(mutex_);
|
std::lock_guard<mutex_t> lock(mutex_);
|
||||||
formatter_ = std::unique_ptr<spdlog::formatter>(new pattern_formatter(pattern));
|
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_);
|
std::lock_guard<mutex_t> lock(mutex_);
|
||||||
formatter_ = std::move(sink_formatter);
|
formatter_ = std::move(sink_formatter);
|
||||||
|
Loading…
Reference in New Issue
Block a user