From 518f93f18f0a9665b05c244d6ab31b1469a45b27 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Sun, 8 Jan 2012 01:36:35 +0000 Subject: [PATCH] Create the json log writer after checking for local config so it goes to the right place Originally committed to SVN as r6249. --- aegisub/src/main.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/aegisub/src/main.cpp b/aegisub/src/main.cpp index d1042ae9d..c8a3623e8 100644 --- a/aegisub/src/main.cpp +++ b/aegisub/src/main.cpp @@ -142,17 +142,14 @@ bool AegisubApp::OnInit() { #endif // logging. - wxString path_log = StandardPaths::DecodePath("?user/log/"); - wxFileName::Mkdir(path_log, 0777, wxPATH_MKDIR_FULL); agi::log::log = new agi::log::LogSink; - agi::log::log->Subscribe(new agi::log::JsonEmitter(STD_STR(path_log), agi::log::log)); #ifdef _DEBUG agi::log::log->Subscribe(new agi::log::EmitSTDOUT()); #endif // Set config file - StartupLog("Load configuration"); + StartupLog("Load local configuration"); #ifdef __WXMSW__ // Try loading configuration from the install dir if one exists there try { @@ -169,6 +166,12 @@ bool AegisubApp::OnInit() { } #endif + StartupLog("Create log writer"); + wxString path_log = StandardPaths::DecodePath("?user/log/"); + wxFileName::Mkdir(path_log, 0777, wxPATH_MKDIR_FULL); + agi::log::log->Subscribe(new agi::log::JsonEmitter(STD_STR(path_log), agi::log::log)); + + StartupLog("Load user configuration"); try { if (!config::opt) config::opt = new agi::Options(STD_STR(StandardPaths::DecodePath("?user/config.json")), GET_DEFAULT_CONFIG(default_config));