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

@ -18,26 +18,6 @@ namespace Log {
class Filter;
/**
* A log entry. Log entries are store in a structured format to permit more varied output
* formatting on different frontends, as well as facilitating filtering and aggregation.
*/
struct Entry {
std::chrono::microseconds timestamp;
Class log_class;
Level log_level;
std::string filename;
unsigned int line_num;
std::string function;
std::string message;
Entry() = default;
Entry(Entry&& o) = default;
Entry& operator=(Entry&& o) = default;
Entry& operator=(const Entry& o) = default;
};
/**
* Interface for logging backends. As loggers can be created and removed at runtime, this can be
* used by a frontend for adding a custom logging backend as needed
@ -112,10 +92,6 @@ const char* GetLogClassName(Class log_class);
*/
const char* GetLevelName(Level log_level);
/// Creates a log entry by formatting the given source location, and message.
Entry CreateEntry(Class log_class, Level log_level, const char* filename, unsigned int line_nr,
const char* function, std::string message);
/**
* The global filter will prevent any messages from even being processed if they are filtered. Each
* backend can have a filter, but if the level is lower than the global filter, the backend will