Add configurable logging backends

This commit is contained in:
James Rowe 2018-07-02 11:10:41 -06:00 committed by bunnei
parent 0d46f0df12
commit 6269a01b4e
14 changed files with 408 additions and 22 deletions

View file

@ -126,7 +126,12 @@ int main(int argc, char** argv) {
#endif
Log::Filter log_filter(Log::Level::Debug);
Log::SetFilter(&log_filter);
Log::SetGlobalFilter(log_filter);
Log::AddBackend(std::make_unique<Log::ColorConsoleBackend>());
FileUtil::CreateFullPath(FileUtil::GetUserPath(D_LOGS_IDX));
Log::AddBackend(
std::make_unique<Log::FileBackend>(FileUtil::GetUserPath(D_LOGS_IDX) + LOG_FILE));
MicroProfileOnThreadCreate("EmuThread");
SCOPE_EXIT({ MicroProfileShutdown(); });