Merge pull request #6199 from lioncash/log-ns

common/log: Move Log namespace into the Common namespace
This commit is contained in:
bunnei 2021-04-14 21:29:44 -07:00 committed by GitHub
commit 60511976bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 58 additions and 45 deletions

View file

@ -74,14 +74,16 @@ static void PrintVersion() {
}
static void InitializeLogging() {
using namespace Common;
Log::Filter log_filter(Log::Level::Debug);
log_filter.ParseFilterString(Settings::values.log_filter);
Log::SetGlobalFilter(log_filter);
Log::AddBackend(std::make_unique<Log::ColorConsoleBackend>());
const std::string& log_dir = Common::FS::GetUserPath(Common::FS::UserPath::LogDir);
Common::FS::CreateFullPath(log_dir);
const std::string& log_dir = FS::GetUserPath(FS::UserPath::LogDir);
FS::CreateFullPath(log_dir);
Log::AddBackend(std::make_unique<Log::FileBackend>(log_dir + LOG_FILE));
#ifdef _WIN32
Log::AddBackend(std::make_unique<Log::DebuggerBackend>());