Logging: Fix fmt errors after rebasing with master

fmt was updated during the clang-format update, which breaks the previous implementation of FmtLogMessage

Changes were:
* Move definition of FmtLogMessage into log.h to use variadic templates as FMT_VARIADIC was removed

To supplement the change above:
* Move Entry and CreateEntry into log.h
* Add LogEntry in backend.cpp
This commit is contained in:
Daniel Lim Wee Soong 2018-03-16 11:48:33 +08:00
parent ab4ba71f3e
commit eee388588e
3 changed files with 37 additions and 33 deletions

View file

@ -265,15 +265,11 @@ void LogMessage(Class log_class, Level log_level, const char* filename, unsigned
Impl::Instance().PushEntry(std::move(entry));
}
void FmtLogMessage(Class log_class, Level log_level, const char* filename, unsigned int line_num,
const char* function, const char* format, fmt::ArgList args) {
void LogEntry(Entry& entry) {
auto filter = Impl::Instance().GetGlobalFilter();
if (!filter.CheckMessage(log_class, log_level))
if (!filter.CheckMessage(entry.log_class, entry.log_level))
return;
Entry entry =
CreateEntry(log_class, log_level, filename, line_num, function, fmt::format(format, args));
Impl::Instance().PushEntry(std::move(entry));
}
} // namespace Log