diff options
author | bunnei <bunneidev@gmail.com> | 2021-08-25 03:31:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-25 03:31:27 +0200 |
commit | 4654fb96b0e2eb1b57857ae7f0438341fb2f9292 (patch) | |
tree | 4b257caf10eb6e7dfd2113671a7ebdcd845dcf3b /src/common | |
parent | Merge pull request #6878 from BreadFish64/optimize-GetHostThreadID (diff) | |
parent | logging: Fix log filter during initialization (diff) | |
download | yuzu-4654fb96b0e2eb1b57857ae7f0438341fb2f9292.tar yuzu-4654fb96b0e2eb1b57857ae7f0438341fb2f9292.tar.gz yuzu-4654fb96b0e2eb1b57857ae7f0438341fb2f9292.tar.bz2 yuzu-4654fb96b0e2eb1b57857ae7f0438341fb2f9292.tar.lz yuzu-4654fb96b0e2eb1b57857ae7f0438341fb2f9292.tar.xz yuzu-4654fb96b0e2eb1b57857ae7f0438341fb2f9292.tar.zst yuzu-4654fb96b0e2eb1b57857ae7f0438341fb2f9292.zip |
Diffstat (limited to '')
-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 @@ #include <atomic> #include <chrono> #include <climits> +#include <exception> #include <thread> #include <vector> @@ -152,7 +153,7 @@ public: void EnableForStacktrace() override {} }; -bool initialization_in_progress_suppress_logging = false; +bool initialization_in_progress_suppress_logging = true; /** * Static state as a singleton. @@ -161,17 +162,17 @@ class Impl { public: static Impl& Instance() { if (!instance) { - abort(); + throw std::runtime_error("Using Logging instance before its initialization"); } return *instance; } static void Initialize() { if (instance) { - abort(); + LOG_WARNING(Log, "Reinitializing logging backend"); + return; } using namespace Common::FS; - initialization_in_progress_suppress_logging = true; const auto& log_dir = GetYuzuPath(YuzuPath::LogDir); void(CreateDir(log_dir)); Filter filter; |