summaryrefslogtreecommitdiffstats
path: root/base/logging.cpp
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2016-10-04 19:17:07 -0700
committerAndreas Gampe <agampe@google.com>2016-10-04 19:19:59 -0700
commitb4e32f3b33eb1d43d81b01e6f5f0815ced3f5e5b (patch)
tree766ea0812050fe8073706d86cc4ecf0587c93f38 /base/logging.cpp
parent1f90485804c6d21018d947531c9495bb42d4ea50 (diff)
downloadsystem_core-b4e32f3b33eb1d43d81b01e6f5f0815ced3f5e5b.tar.gz
system_core-b4e32f3b33eb1d43d81b01e6f5f0815ced3f5e5b.tar.bz2
system_core-b4e32f3b33eb1d43d81b01e6f5f0815ced3f5e5b.zip
Base: Hand complete log message to aborter
Undo zero-termination-substitution for linebreaks when logging. This results in handing the complete log message to the aborter. Add a test. Bug: 31893081 Test: mmma system/core/base && $ANDROID_HOST_OUT/nativetest64/libbase_test/libbase_test64 Change-Id: I2ef6c6351db2fd494a02985f634f439104136227
Diffstat (limited to 'base/logging.cpp')
-rw-r--r--base/logging.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/base/logging.cpp b/base/logging.cpp
index ece10ecdd..dab86fe89 100644
--- a/base/logging.cpp
+++ b/base/logging.cpp
@@ -415,6 +415,8 @@ LogMessage::~LogMessage() {
msg[nl] = '\0';
LogLine(data_->GetFile(), data_->GetLineNumber(), data_->GetId(),
data_->GetSeverity(), &msg[i]);
+ // Undo the zero-termination so we can give the complete message to the aborter.
+ msg[nl] = '\n';
i = nl + 1;
}
}