Micoro optimize macros

This commit is contained in:
gabime
2019-06-19 17:13:48 +03:00
parent b9cc158e52
commit 74e2aa9c66
2 changed files with 13 additions and 8 deletions

View File

@@ -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)
{