Skip to content

Commit

Permalink
Try logging to the log sink on fatal error
Browse files Browse the repository at this point in the history
  • Loading branch information
roxanneskelly committed Jul 31, 2024
1 parent 34f01da commit ae085bf
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions build/patches/crash_on_fatal_error.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
diff --git a/rtc_base/checks.cc b/rtc_base/checks.cc
index e732a2659d..72b235fd4f 100644
index e732a2659d..593918e02f 100644
--- a/rtc_base/checks.cc
+++ b/rtc_base/checks.cc
@@ -24,6 +24,8 @@
@@ -16,6 +16,7 @@
#include <cstdlib>

#include "absl/strings/string_view.h"
+#include "logging.h"

#if defined(WEBRTC_ANDROID)
#define RTC_LOG_TAG_ANDROID "rtc"
@@ -24,6 +25,8 @@

#if defined(WEBRTC_WIN)
#include <windows.h>
Expand All @@ -11,7 +19,7 @@ index e732a2659d..72b235fd4f 100644
#endif

#if defined(WEBRTC_WIN)
@@ -69,13 +71,26 @@ RTC_NORETURN void WriteFatalLog(absl::string_view output) {
@@ -69,13 +72,28 @@ RTC_NORETURN void WriteFatalLog(absl::string_view output) {
__android_log_print(ANDROID_LOG_ERROR, RTC_LOG_TAG_ANDROID, "%s\n",
output_str.c_str());
#endif
Expand All @@ -20,6 +28,8 @@ index e732a2659d..72b235fd4f 100644
fflush(stdout);
fwrite(output.data(), output.size(), 1, stderr);
fflush(stderr);
+ // attempt to notify the logging subsystem to broadcast to the sinks.
+ RTC_LOG(LS_ERROR) << output_str.c_str() << "\n";
#if defined(WEBRTC_WIN)
- DebugBreak();
+// DebugBreak();
Expand Down

0 comments on commit ae085bf

Please sign in to comment.