diff options
Diffstat (limited to 'lib/sanitizer_common/sanitizer_mac.cc')
-rw-r--r-- | lib/sanitizer_common/sanitizer_mac.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/sanitizer_common/sanitizer_mac.cc b/lib/sanitizer_common/sanitizer_mac.cc index 1c96a6b95621..715509d30746 100644 --- a/lib/sanitizer_common/sanitizer_mac.cc +++ b/lib/sanitizer_common/sanitizer_mac.cc @@ -430,6 +430,12 @@ void WriteOneLineToSyslog(const char *s) { asl_log(nullptr, nullptr, ASL_LEVEL_ERR, "%s", s); } +void LogMessageOnPrintf(const char *str) { + // Log all printf output to CrashLog. + if (common_flags()->abort_on_error) + CRAppendCrashLogMessage(str); +} + void LogFullErrorReport(const char *buffer) { // Log with os_trace. This will make it into the crash log. #if SANITIZER_OS_TRACE @@ -463,9 +469,7 @@ void LogFullErrorReport(const char *buffer) { if (common_flags()->log_to_syslog) WriteToSyslog(buffer); - // Log to CrashLog. - if (common_flags()->abort_on_error) - CRSetCrashLogMessage(buffer); + // The report is added to CrashLog as part of logging all of Printf output. } void GetPcSpBp(void *context, uptr *pc, uptr *sp, uptr *bp) { |