diff options
Diffstat (limited to 'src/common/logging/backend.cpp')
| -rw-r--r-- | src/common/logging/backend.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/common/logging/backend.cpp b/src/common/logging/backend.cpp index 4e7cfdc99..6f1d251e1 100644 --- a/src/common/logging/backend.cpp +++ b/src/common/logging/backend.cpp | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | #include <atomic> | 5 | #include <atomic> |
| 6 | #include <chrono> | 6 | #include <chrono> |
| 7 | #include <climits> | 7 | #include <climits> |
| 8 | #include <exception> | ||
| 8 | #include <thread> | 9 | #include <thread> |
| 9 | #include <vector> | 10 | #include <vector> |
| 10 | 11 | ||
| @@ -160,7 +161,7 @@ public: | |||
| 160 | void EnableForStacktrace() override {} | 161 | void EnableForStacktrace() override {} |
| 161 | }; | 162 | }; |
| 162 | 163 | ||
| 163 | bool initialization_in_progress_suppress_logging = false; | 164 | bool initialization_in_progress_suppress_logging = true; |
| 164 | 165 | ||
| 165 | #ifdef YUZU_LINUX_GCC_BACKTRACE | 166 | #ifdef YUZU_LINUX_GCC_BACKTRACE |
| 166 | [[noreturn]] void SleepForever() { | 167 | [[noreturn]] void SleepForever() { |
| @@ -177,17 +178,17 @@ class Impl { | |||
| 177 | public: | 178 | public: |
| 178 | static Impl& Instance() { | 179 | static Impl& Instance() { |
| 179 | if (!instance) { | 180 | if (!instance) { |
| 180 | abort(); | 181 | throw std::runtime_error("Using Logging instance before its initialization"); |
| 181 | } | 182 | } |
| 182 | return *instance; | 183 | return *instance; |
| 183 | } | 184 | } |
| 184 | 185 | ||
| 185 | static void Initialize() { | 186 | static void Initialize() { |
| 186 | if (instance) { | 187 | if (instance) { |
| 187 | abort(); | 188 | LOG_WARNING(Log, "Reinitializing logging backend"); |
| 189 | return; | ||
| 188 | } | 190 | } |
| 189 | using namespace Common::FS; | 191 | using namespace Common::FS; |
| 190 | initialization_in_progress_suppress_logging = true; | ||
| 191 | const auto& log_dir = GetYuzuPath(YuzuPath::LogDir); | 192 | const auto& log_dir = GetYuzuPath(YuzuPath::LogDir); |
| 192 | void(CreateDir(log_dir)); | 193 | void(CreateDir(log_dir)); |
| 193 | Filter filter; | 194 | Filter filter; |