mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-07-10 10:42:55 -05:00
common: logging: Implement Android logcat backend.
This commit is contained in:
@ -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()};
|
||||
|
Reference in New Issue
Block a user