Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(336)

Unified Diff: webrtc/base/checks.cc

Issue 1911903002: Add last error to fatal error messages. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Address comments Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/checks.cc
diff --git a/webrtc/base/checks.cc b/webrtc/base/checks.cc
index 49a31f29b9df4e4d6bca59e4d5f338a5a15ae802..d9dc8f2d63bff7c2d51e5dce77ca9ef8ec4c486c 100644
--- a/webrtc/base/checks.cc
+++ b/webrtc/base/checks.cc
@@ -22,11 +22,16 @@
#endif
#if defined(WEBRTC_ANDROID)
-#define LOG_TAG "rtc"
+#define RTC_LOG_TAG "rtc"
#include <android/log.h> // NOLINT
#endif
+#if defined(WEBRTC_WIN)
+#include <windows.h>
+#endif
+
#include "webrtc/base/checks.h"
+#include "webrtc/base/logging.h"
#if defined(_MSC_VER)
// Warning C4722: destructor never returns, potential memory leak.
@@ -38,7 +43,7 @@ namespace rtc {
void VPrintError(const char* format, va_list args) {
#if defined(WEBRTC_ANDROID)
- __android_log_vprint(ANDROID_LOG_ERROR, LOG_TAG, format, args);
+ __android_log_vprint(ANDROID_LOG_ERROR, RTC_LOG_TAG, format, args);
#else
vfprintf(stderr, format, args);
#endif
@@ -105,8 +110,11 @@ NO_RETURN FatalMessage::~FatalMessage() {
}
void FatalMessage::Init(const char* file, int line) {
- stream_ << std::endl << std::endl << "#" << std::endl << "# Fatal error in "
- << file << ", line " << line << std::endl << "# ";
+ stream_ << std::endl << std::endl
+ << "#" << std::endl
+ << "# Fatal error in " << file << ", line " << line << std::endl
+ << "# last system error: " << LAST_SYSTEM_ERROR << std::endl
+ << "# ";
}
// MSVC doesn't like complex extern templates and DLLs.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698