Common/Log: Add basic fmt-capable functions to the interface.

Provides a basic extension to the interface to begin migration off of
the printf-based logging system.

Everything will go through macros with the same style naming as the old
logging system, except the macros will have the _FMT suffix, while the
migration is in process.

This allows for peacemeal migration over time instead of pulling
everything out and replacing it all in a single pull request, which
makes for much easier reviewing.
This commit is contained in:
Lioncash
2020-10-20 15:37:02 -04:00
parent dc5ae5ee66
commit 425f2aa013
4 changed files with 95 additions and 26 deletions

View File

@ -38,10 +38,7 @@ public:
static void Init();
static void Shutdown();
void Log(LOG_LEVELS level, LOG_TYPE type, const char* file, int line, const char* fmt,
va_list args);
void LogWithFullPath(LOG_LEVELS level, LOG_TYPE type, const char* file, int line, const char* fmt,
va_list args);
void Log(LOG_LEVELS level, LOG_TYPE type, const char* file, int line, const char* message);
LOG_LEVELS GetLogLevel() const;
void SetLogLevel(LOG_LEVELS level);
@ -76,6 +73,9 @@ private:
LogManager(LogManager&&) = delete;
LogManager& operator=(LogManager&&) = delete;
void LogWithFullPath(LOG_LEVELS level, LOG_TYPE type, const char* file, int line,
const char* message);
LOG_LEVELS m_level;
std::array<LogContainer, NUMBER_OF_LOGS> m_log{};
std::array<LogListener*, LogListener::NUMBER_OF_LISTENERS> m_listeners{};