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 13edda9c9..949384fd3 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 | ||
| @@ -152,7 +153,7 @@ public: | |||
| 152 | void EnableForStacktrace() override {} | 153 | void EnableForStacktrace() override {} |
| 153 | }; | 154 | }; |
| 154 | 155 | ||
| 155 | bool initialization_in_progress_suppress_logging = false; | 156 | bool initialization_in_progress_suppress_logging = true; |
| 156 | 157 | ||
| 157 | /** | 158 | /** |
| 158 | * Static state as a singleton. | 159 | * Static state as a singleton. |
| @@ -161,17 +162,17 @@ class Impl { | |||
| 161 | public: | 162 | public: |
| 162 | static Impl& Instance() { | 163 | static Impl& Instance() { |
| 163 | if (!instance) { | 164 | if (!instance) { |
| 164 | abort(); | 165 | throw std::runtime_error("Using Logging instance before its initialization"); |
| 165 | } | 166 | } |
| 166 | return *instance; | 167 | return *instance; |
| 167 | } | 168 | } |
| 168 | 169 | ||
| 169 | static void Initialize() { | 170 | static void Initialize() { |
| 170 | if (instance) { | 171 | if (instance) { |
| 171 | abort(); | 172 | LOG_WARNING(Log, "Reinitializing logging backend"); |
| 173 | return; | ||
| 172 | } | 174 | } |
| 173 | using namespace Common::FS; | 175 | using namespace Common::FS; |
| 174 | initialization_in_progress_suppress_logging = true; | ||
| 175 | const auto& log_dir = GetYuzuPath(YuzuPath::LogDir); | 176 | const auto& log_dir = GetYuzuPath(YuzuPath::LogDir); |
| 176 | void(CreateDir(log_dir)); | 177 | void(CreateDir(log_dir)); |
| 177 | Filter filter; | 178 | Filter filter; |