@@ -769,11 +769,17 @@ void internal_join_thread(void *th) { pthread_join((pthread_t)th, 0); }
769
769
static Mutex syslog_lock;
770
770
# endif
771
771
772
+ # if SANITIZER_DRIVERKIT
773
+ # define SANITIZER_OS_LOG os_log
774
+ # else
775
+ # define SANITIZER_OS_LOG os_log_error
776
+ # endif
777
+
772
778
void WriteOneLineToSyslog (const char *s) {
773
779
#if !SANITIZER_GO
774
780
syslog_lock.CheckLocked ();
775
781
if (GetMacosAlignedVersion () >= MacosVersion (10 , 12 )) {
776
- os_log_error (OS_LOG_DEFAULT, " %{public}s" , s);
782
+ SANITIZER_OS_LOG (OS_LOG_DEFAULT, " %{public}s" , s);
777
783
} else {
778
784
#pragma clang diagnostic push
779
785
// as_log is deprecated.
@@ -837,22 +843,22 @@ void LogMessageOnPrintf(const char *str) {
837
843
838
844
void LogFullErrorReport (const char *buffer) {
839
845
# if !SANITIZER_GO
840
- // Log with os_log_error. This will make it into the crash log.
846
+ // When logging with os_log_error this will make it into the crash log.
841
847
if (internal_strncmp (SanitizerToolName, " AddressSanitizer" ,
842
848
sizeof (" AddressSanitizer" ) - 1 ) == 0 )
843
- os_log_error (OS_LOG_DEFAULT, " Address Sanitizer reported a failure." );
849
+ SANITIZER_OS_LOG (OS_LOG_DEFAULT, " Address Sanitizer reported a failure." );
844
850
else if (internal_strncmp (SanitizerToolName, " UndefinedBehaviorSanitizer" ,
845
851
sizeof (" UndefinedBehaviorSanitizer" ) - 1 ) == 0 )
846
- os_log_error (OS_LOG_DEFAULT,
847
- " Undefined Behavior Sanitizer reported a failure." );
852
+ SANITIZER_OS_LOG (OS_LOG_DEFAULT,
853
+ " Undefined Behavior Sanitizer reported a failure." );
848
854
else if (internal_strncmp (SanitizerToolName, " ThreadSanitizer" ,
849
855
sizeof (" ThreadSanitizer" ) - 1 ) == 0 )
850
- os_log_error (OS_LOG_DEFAULT, " Thread Sanitizer reported a failure." );
856
+ SANITIZER_OS_LOG (OS_LOG_DEFAULT, " Thread Sanitizer reported a failure." );
851
857
else
852
- os_log_error (OS_LOG_DEFAULT, " Sanitizer tool reported a failure." );
858
+ SANITIZER_OS_LOG (OS_LOG_DEFAULT, " Sanitizer tool reported a failure." );
853
859
854
860
if (common_flags ()->log_to_syslog )
855
- os_log_error (OS_LOG_DEFAULT, " Consult syslog for more information." );
861
+ SANITIZER_OS_LOG (OS_LOG_DEFAULT, " Consult syslog for more information." );
856
862
857
863
// Log to syslog.
858
864
// The logging on OS X may call pthread_create so we need the threading
0 commit comments