diff options
author | bunnei <bunneidev@gmail.com> | 2022-12-18 08:31:09 +0100 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2023-06-03 09:05:26 +0200 |
commit | 99296a15108f950c60c7864a374e3ef1f5909e76 (patch) | |
tree | 6189575f5e74f658d3181fdd2467bf894a5bf940 /src/common/logging/backend.cpp | |
parent | common: host_memory: Implement for Android. (diff) | |
download | yuzu-99296a15108f950c60c7864a374e3ef1f5909e76.tar yuzu-99296a15108f950c60c7864a374e3ef1f5909e76.tar.gz yuzu-99296a15108f950c60c7864a374e3ef1f5909e76.tar.bz2 yuzu-99296a15108f950c60c7864a374e3ef1f5909e76.tar.lz yuzu-99296a15108f950c60c7864a374e3ef1f5909e76.tar.xz yuzu-99296a15108f950c60c7864a374e3ef1f5909e76.tar.zst yuzu-99296a15108f950c60c7864a374e3ef1f5909e76.zip |
Diffstat (limited to '')
-rw-r--r-- | src/common/logging/backend.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/common/logging/backend.cpp b/src/common/logging/backend.cpp index f96c7c222..6e8e8eb36 100644 --- a/src/common/logging/backend.cpp +++ b/src/common/logging/backend.cpp @@ -155,6 +155,26 @@ public: void EnableForStacktrace() override {} }; +#ifdef ANDROID +/** + * Backend that writes to the Android logcat + */ +class LogcatBackend : public Backend { +public: + explicit LogcatBackend() = default; + + ~LogcatBackend() override = default; + + void Write(const Entry& entry) override { + PrintMessageToLogcat(entry); + } + + void Flush() override {} + + void EnableForStacktrace() override {} +}; +#endif + bool initialization_in_progress_suppress_logging = true; /** @@ -260,6 +280,9 @@ private: lambda(static_cast<Backend&>(debugger_backend)); lambda(static_cast<Backend&>(color_console_backend)); lambda(static_cast<Backend&>(file_backend)); +#ifdef ANDROID + lambda(static_cast<Backend&>(lc_backend)); +#endif } static void Deleter(Impl* ptr) { @@ -272,6 +295,9 @@ private: DebuggerBackend debugger_backend{}; ColorConsoleBackend color_console_backend{}; FileBackend file_backend; +#ifdef ANDROID + LogcatBackend lc_backend{}; +#endif MPSCQueue<Entry> message_queue{}; std::chrono::steady_clock::time_point time_origin{std::chrono::steady_clock::now()}; |