summaryrefslogtreecommitdiff
path: root/src/common/logging/backend.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2023-06-05 21:43:43 -0700
committerGitHub <noreply@github.com>2023-06-05 21:43:43 -0700
commitcb95d7fe1b6d81899fe6b279400da2c991e3132c (patch)
treea856ac45b1053009c4c11ee141c49d7faa4c8a19 /src/common/logging/backend.cpp
parentdb7b106f1d9d559dadfd9ed070a8b0986609ec57 (diff)
parent036996429e1766231c5002bb333ee4e67d216c2c (diff)
Merge pull request #10508 from yuzu-emu/lime
Project Lime - yuzu Android Port
Diffstat (limited to 'src/common/logging/backend.cpp')
-rw-r--r--src/common/logging/backend.cpp26
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()};