From 5102b5c4f206de703f6181d6fe65ecfe9eaa4cc8 Mon Sep 17 00:00:00 2001 From: LoveSy Date: Sun, 26 Sep 2021 22:04:13 +0800 Subject: [PATCH] [core] Log everything from daemon (#1180) * [core] Log everything from daemon * 1 --- core/src/main/cpp/daemon/logcat.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/src/main/cpp/daemon/logcat.cpp b/core/src/main/cpp/daemon/logcat.cpp index ef9350dd..41d75c55 100644 --- a/core/src/main/cpp/daemon/logcat.cpp +++ b/core/src/main/cpp/daemon/logcat.cpp @@ -65,6 +65,8 @@ private: size_t verbose_file_part_ = 0; size_t verbose_print_count_ = 0; + pid_t my_pid_ = getpid(); + bool verbose_ = true; }; @@ -151,12 +153,12 @@ void Logcat::ProcessBuffer(struct log_msg *buf) { shortcut = true; } if (verbose_ && (shortcut || buf->id() == log_id::LOG_ID_CRASH || - tag == "Magisk"sv || + entry.pid == my_pid_ || tag == "Magisk"sv || tag.starts_with("Riru"sv) || tag.starts_with("LSPosed"sv))) [[unlikely]] { verbose_print_count_ += PrintLogLine(entry, verbose_file_.get()); } - if (entry.pid == getpid() && tag == "LSPosedLogcat"sv) [[unlikely]] { + if (entry.pid == my_pid_ && tag == "LSPosedLogcat"sv) [[unlikely]] { std::string_view msg(entry.message, entry.messageLen); if (msg == "!!start_verbose!!"sv) { verbose_ = true;