summaryrefslogtreecommitdiffstats
path: root/src/yuzu_cmd/yuzu.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-07-22 03:30:04 +0200
committerGitHub <noreply@github.com>2018-07-22 03:30:04 +0200
commit9533875eeb729d20ce2f92e9363a55c5894d262a (patch)
treefb594e919f10e136dfcb523a71b1dd6a3a30bb53 /src/yuzu_cmd/yuzu.cpp
parentMerge pull request #762 from Subv/ioctl2 (diff)
parentfile_util: Use an enum class for GetUserPath() (diff)
downloadyuzu-9533875eeb729d20ce2f92e9363a55c5894d262a.tar
yuzu-9533875eeb729d20ce2f92e9363a55c5894d262a.tar.gz
yuzu-9533875eeb729d20ce2f92e9363a55c5894d262a.tar.bz2
yuzu-9533875eeb729d20ce2f92e9363a55c5894d262a.tar.lz
yuzu-9533875eeb729d20ce2f92e9363a55c5894d262a.tar.xz
yuzu-9533875eeb729d20ce2f92e9363a55c5894d262a.tar.zst
yuzu-9533875eeb729d20ce2f92e9363a55c5894d262a.zip
Diffstat (limited to '')
-rw-r--r--src/yuzu_cmd/yuzu.cpp21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/yuzu_cmd/yuzu.cpp b/src/yuzu_cmd/yuzu.cpp
index 24db1065a..b5392c499 100644
--- a/src/yuzu_cmd/yuzu.cpp
+++ b/src/yuzu_cmd/yuzu.cpp
@@ -56,6 +56,18 @@ static void PrintVersion() {
std::cout << "yuzu " << Common::g_scm_branch << " " << Common::g_scm_desc << std::endl;
}
+static void InitializeLogging() {
+ 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 = FileUtil::GetUserPath(FileUtil::UserPath::LogDir);
+ FileUtil::CreateFullPath(log_dir);
+ Log::AddBackend(std::make_unique<Log::FileBackend>(log_dir + LOG_FILE));
+}
+
/// Application entry point
int main(int argc, char** argv) {
Config config;
@@ -124,14 +136,7 @@ int main(int argc, char** argv) {
LocalFree(argv_w);
#endif
- 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>());
- FileUtil::CreateFullPath(FileUtil::GetUserPath(D_LOGS_IDX));
- Log::AddBackend(
- std::make_unique<Log::FileBackend>(FileUtil::GetUserPath(D_LOGS_IDX) + LOG_FILE));
+ InitializeLogging();
MicroProfileOnThreadCreate("EmuThread");
SCOPE_EXIT({ MicroProfileShutdown(); });