[PATCH] D24781: [ubsan] Respect log_to_syslog=1 on Darwin

Vedant Kumar via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 20 15:24:05 PDT 2016


vsk added a comment.

Thanks for your comments. I can think of two ways to preserve color output while writing to syslog --


================
Comment at: lib/sanitizer_common/sanitizer_common_libcdep.cc:41
@@ +40,3 @@
+  // The macOS syslog viewer doesn't know what to do with color codes.
+  if (common_flags()->log_to_syslog)
+    return false;
----------------
zaks.anna wrote:
> Doesn't this strip coloring from all outputs whenever log_to_system is set? I think what we want is not to show the coloring only in syslog and in the CrashLogs on the mac.
> 
> Please, see 
> https://reviews.llvm.org/D15396
> (and it's predecessor http://reviews.llvm.org/D13452)
Should I modify `LogMessageOnPrintf` on Mac platforms so that it prints to syslog when `common_flags()->abort_on_error` isn't set? The shared printf code should take care of removing color codes. However, this might trigger extra logging on mac.

Or, should I just introduce Mac-specific logic to remove color codes in the PrintToLog function introduced by this patch?


https://reviews.llvm.org/D24781





More information about the llvm-commits mailing list