mirror of
https://github.com/gabime/spdlog.git
synced 2025-09-30 10:29:02 +08:00
Micoro optimize macros
This commit is contained in:
@@ -63,13 +63,8 @@ public:
|
||||
void swap(spdlog::logger &other);
|
||||
|
||||
template<typename... Args>
|
||||
void log(source_loc loc, level::level_enum lvl, const char *fmt, const Args &... args)
|
||||
void force_log(source_loc loc, level::level_enum lvl, const char *fmt, const Args &... args)
|
||||
{
|
||||
if (!should_log(lvl))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
fmt::memory_buffer buf;
|
||||
@@ -87,6 +82,15 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
template<typename... Args>
|
||||
void log(source_loc loc, level::level_enum lvl, const char *fmt, const Args &... args)
|
||||
{
|
||||
if (should_log(lvl))
|
||||
{
|
||||
force_log(loc, lvl, fmt, args...);
|
||||
}
|
||||
}
|
||||
|
||||
template<typename... Args>
|
||||
void log(level::level_enum lvl, const char *fmt, const Args &... args)
|
||||
{
|
||||
|
Reference in New Issue
Block a user