mirror of
https://github.com/gabime/spdlog.git
synced 2024-11-15 16:35:45 +08:00
check should_log in log_with_format_
This commit is contained in:
parent
f755cfc0e7
commit
ac6b7ec87e
@ -80,7 +80,11 @@ public:
|
||||
template<typename... Args>
|
||||
void log(source_loc loc, level::level_enum lvl, format_string_t<Args...> fmt, Args &&...args)
|
||||
{
|
||||
log_with_format_(loc, lvl, details::to_string_view(fmt), std::forward<Args>(args)...);
|
||||
if (should_log(lvl))
|
||||
{
|
||||
log_with_format_(loc, lvl, details::to_string_view(fmt), std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
template<typename... Args>
|
||||
@ -247,10 +251,7 @@ protected:
|
||||
template<typename... Args>
|
||||
void log_with_format_(source_loc loc, level::level_enum lvl, string_view_t fmt, Args &&...args)
|
||||
{
|
||||
if (!should_log(lvl))
|
||||
{
|
||||
return;
|
||||
}
|
||||
assert(should_log(lvl));
|
||||
SPDLOG_TRY
|
||||
{
|
||||
memory_buf_t buf;
|
||||
|
Loading…
Reference in New Issue
Block a user