mirror of
https://github.com/gabime/spdlog.git
synced 2024-12-26 10:31:34 +08:00
Fixed clang-tidy warnings
This commit is contained in:
parent
7af3f014af
commit
a06d32ae19
@ -58,7 +58,7 @@ public:
|
|||||||
std::shared_ptr<logger> clone(std::string new_name) override;
|
std::shared_ptr<logger> clone(std::string new_name) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void sink_it_(details::log_msg &msg) override;
|
void sink_it_(const details::log_msg &msg) override;
|
||||||
void flush_() override;
|
void flush_() override;
|
||||||
|
|
||||||
void backend_log_(const details::log_msg &incoming_log_msg);
|
void backend_log_(const details::log_msg &incoming_log_msg);
|
||||||
|
@ -36,14 +36,14 @@ inline spdlog::async_logger::async_logger(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// send the log message to the thread pool
|
// send the log message to the thread pool
|
||||||
inline void spdlog::async_logger::sink_it_(details::log_msg &msg)
|
inline void spdlog::async_logger::sink_it_(const details::log_msg &msg)
|
||||||
{
|
{
|
||||||
#if defined(SPDLOG_ENABLE_MESSAGE_COUNTER)
|
#if defined(SPDLOG_ENABLE_MESSAGE_COUNTER)
|
||||||
incr_msg_counter_(msg);
|
incr_msg_counter_(msg);
|
||||||
#endif
|
#endif
|
||||||
if (auto pool_ptr = thread_pool_.lock())
|
if (auto pool_ptr = thread_pool_.lock())
|
||||||
{
|
{
|
||||||
pool_ptr->post_log(shared_from_this(), std::move(msg), overflow_policy_);
|
pool_ptr->post_log(shared_from_this(), msg, overflow_policy_);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -296,7 +296,7 @@ inline bool spdlog::logger::should_log(spdlog::level::level_enum msg_level) cons
|
|||||||
// protected virtual called at end of each user log call (if enabled) by the
|
// protected virtual called at end of each user log call (if enabled) by the
|
||||||
// line_logger
|
// line_logger
|
||||||
//
|
//
|
||||||
inline void spdlog::logger::sink_it_(details::log_msg &msg)
|
inline void spdlog::logger::sink_it_(const details::log_msg &msg)
|
||||||
{
|
{
|
||||||
#if defined(SPDLOG_ENABLE_MESSAGE_COUNTER)
|
#if defined(SPDLOG_ENABLE_MESSAGE_COUNTER)
|
||||||
incr_msg_counter_(msg);
|
incr_msg_counter_(msg);
|
||||||
|
@ -69,7 +69,7 @@ struct async_msg
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// construct from log_msg with given type
|
// construct from log_msg with given type
|
||||||
async_msg(async_logger_ptr &&worker, async_msg_type the_type, details::log_msg &&m)
|
async_msg(async_logger_ptr &&worker, async_msg_type the_type, const details::log_msg &m)
|
||||||
: msg_type(the_type)
|
: msg_type(the_type)
|
||||||
, level(m.level)
|
, level(m.level)
|
||||||
, time(m.time)
|
, time(m.time)
|
||||||
@ -146,9 +146,9 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void post_log(async_logger_ptr &&worker_ptr, details::log_msg &&msg, async_overflow_policy overflow_policy)
|
void post_log(async_logger_ptr &&worker_ptr, const details::log_msg &msg, async_overflow_policy overflow_policy)
|
||||||
{
|
{
|
||||||
async_msg async_m(std::forward<async_logger_ptr>(worker_ptr), async_msg_type::log, std::forward<log_msg>(msg));
|
async_msg async_m(std::forward<async_logger_ptr>(worker_ptr), async_msg_type::log, msg);
|
||||||
post_async_msg_(std::move(async_m), overflow_policy);
|
post_async_msg_(std::move(async_m), overflow_policy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -137,7 +137,7 @@ public:
|
|||||||
virtual std::shared_ptr<logger> clone(std::string logger_name);
|
virtual std::shared_ptr<logger> clone(std::string logger_name);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void sink_it_(details::log_msg &msg);
|
virtual void sink_it_(const details::log_msg &msg);
|
||||||
virtual void flush_();
|
virtual void flush_();
|
||||||
|
|
||||||
bool should_flush_(const details::log_msg &msg);
|
bool should_flush_(const details::log_msg &msg);
|
||||||
|
Loading…
Reference in New Issue
Block a user