Title: [262831] trunk/Source/WTF
Revision
262831
Author
[email protected]
Date
2020-06-09 19:04:48 -0700 (Tue, 09 Jun 2020)

Log Message

Use os_log instead of asl_log
https://bugs.webkit.org/show_bug.cgi?id=213001

Reviewed by Saam Barati.

* WTF.xcodeproj/project.pbxproj:
* wtf/Assertions.cpp:

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (262830 => 262831)


--- trunk/Source/WTF/ChangeLog	2020-06-10 02:04:14 UTC (rev 262830)
+++ trunk/Source/WTF/ChangeLog	2020-06-10 02:04:48 UTC (rev 262831)
@@ -1,3 +1,13 @@
+2020-06-09  Tim Horton  <[email protected]>
+
+        Use os_log instead of asl_log
+        https://bugs.webkit.org/show_bug.cgi?id=213001
+
+        Reviewed by Saam Barati.
+
+        * WTF.xcodeproj/project.pbxproj:
+        * wtf/Assertions.cpp:
+
 2020-06-09  Chris Dumez  <[email protected]>
 
         Use bridge cast in String(NSString *) constructor

Modified: trunk/Source/WTF/WTF.xcodeproj/project.pbxproj (262830 => 262831)


--- trunk/Source/WTF/WTF.xcodeproj/project.pbxproj	2020-06-10 02:04:14 UTC (rev 262830)
+++ trunk/Source/WTF/WTF.xcodeproj/project.pbxproj	2020-06-10 02:04:48 UTC (rev 262831)
@@ -361,6 +361,7 @@
 		2CDED0EE18115C38004DBA70 /* RunLoopCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RunLoopCF.cpp; sourceTree = "<group>"; };
 		2CDED0F118115C85004DBA70 /* RunLoop.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RunLoop.cpp; sourceTree = "<group>"; };
 		2CDED0F218115C85004DBA70 /* RunLoop.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RunLoop.h; sourceTree = "<group>"; };
+		2DA442FC24904CA000C9C59D /* OSLogSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = OSLogSPI.h; sourceTree = "<group>"; };
 		304CA4E41375437EBE931D03 /* Markable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Markable.h; sourceTree = "<group>"; };
 		3137E1D7DBD84AC38FAE4D34 /* IndexSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IndexSet.h; sourceTree = "<group>"; };
 		313EDEC9778E49C9BEA91CFC /* StackTrace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StackTrace.cpp; sourceTree = "<group>"; };
@@ -1457,6 +1458,7 @@
 				E31BDE2822E913CC0029B105 /* MachVMSPI.h */,
 				1C503BE423AADEEA0072E66B /* NSLocaleSPI.h */,
 				93D191CF20CAECE800C51B8E /* objcSPI.h */,
+				2DA442FC24904CA000C9C59D /* OSLogSPI.h */,
 				A5098B011C16A4F900087797 /* SecuritySPI.h */,
 			);
 			path = cocoa;
@@ -1766,7 +1768,6 @@
 				A8A47469151A825B004123FF /* UTF8Conversion.cpp in Sources */,
 				7AFEC6B11EB22B5900DADE36 /* UUID.cpp in Sources */,
 				E3149A39228BB43500BFA6C7 /* Vector.cpp in Sources */,
-				FE032AD22463E43B0012D7C7 /* WTFConfig.cpp in Sources */,
 				0F66B2921DC97BAB004A1D3F /* WallTime.cpp in Sources */,
 				1FA47C8A152502DA00568D1B /* WebCoreThread.cpp in Sources */,
 				0FE4479C1B7AAA03009498EB /* WordLock.cpp in Sources */,
@@ -1774,6 +1775,7 @@
 				E4A0AD391A96245500536DF6 /* WorkQueue.cpp in Sources */,
 				E4A0AD3D1A96253C00536DF6 /* WorkQueueCocoa.cpp in Sources */,
 				FE05FAFF1FE5007500093230 /* WTFAssertions.cpp in Sources */,
+				FE032AD22463E43B0012D7C7 /* WTFConfig.cpp in Sources */,
 				A8A47445151A825B004123FF /* WTFString.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;

Modified: trunk/Source/WTF/wtf/Assertions.cpp (262830 => 262831)


--- trunk/Source/WTF/wtf/Assertions.cpp	2020-06-10 02:04:14 UTC (rev 262830)
+++ trunk/Source/WTF/wtf/Assertions.cpp	2020-06-10 02:04:48 UTC (rev 262831)
@@ -25,12 +25,6 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-// The vprintf_stderr_common function triggers this error in the Mac build.
-// Feel free to remove this pragma if this file builds on Mac.
-// According to http://gcc.gnu.org/onlinedocs/gcc-4.2.1/gcc/Diagnostic-Pragmas.html#Diagnostic-Pragmas
-// we need to place this directive before any data or functions are defined.
-#pragma GCC diagnostic ignored "-Wmissing-format-attribute"
-
 #include "config.h"
 #include <wtf/Assertions.h>
 
@@ -49,10 +43,6 @@
 
 #if USE(CF)
 #include <CoreFoundation/CFString.h>
-#if PLATFORM(COCOA)
-#define USE_APPLE_SYSTEM_LOG 1
-#include <asl.h>
-#endif
 #endif // USE(CF)
 
 #if COMPILER(MSVC)
@@ -72,6 +62,10 @@
 #include <wtf/StringPrintStream.h>
 #endif
 
+#if PLATFORM(COCOA)
+#import <wtf/spi/cocoa/OSLogSPI.h>
+#endif
+
 namespace WTF {
 
 WTF_ATTRIBUTE_PRINTF(1, 0) static String createWithFormatAndArguments(const char* format, va_list args)
@@ -126,10 +120,8 @@
 
 static void logToStderr(const char* buffer)
 {
-#if USE(APPLE_SYSTEM_LOG)
-    ALLOW_DEPRECATED_DECLARATIONS_BEGIN
-    asl_log(0, 0, ASL_LEVEL_NOTICE, "%s", buffer);
-    ALLOW_DEPRECATED_DECLARATIONS_END
+#if PLATFORM(COCOA)
+    os_log(OS_LOG_DEFAULT, "%s", buffer);
 #endif
     fputs(buffer, stderr);
 }
@@ -154,13 +146,11 @@
         return;
     }
 
-#if USE(APPLE_SYSTEM_LOG)
-    ALLOW_DEPRECATED_DECLARATIONS_BEGIN
+#if PLATFORM(COCOA)
     va_list copyOfArgs;
     va_copy(copyOfArgs, args);
-    asl_vlog(0, 0, ASL_LEVEL_NOTICE, format, copyOfArgs);
+    os_log_with_args(OS_LOG_DEFAULT, OS_LOG_TYPE_DEFAULT, format, copyOfArgs, __builtin_return_address(0));
     va_end(copyOfArgs);
-    ALLOW_DEPRECATED_DECLARATIONS_END
 #endif
 
     // Fall through to write to stderr in the same manner as other platforms.

Added: trunk/Source/WTF/wtf/spi/cocoa/OSLogSPI.h (0 => 262831)


--- trunk/Source/WTF/wtf/spi/cocoa/OSLogSPI.h	                        (rev 0)
+++ trunk/Source/WTF/wtf/spi/cocoa/OSLogSPI.h	2020-06-10 02:04:48 UTC (rev 262831)
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2020 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include <os/log.h>
+
+#if USE(APPLE_INTERNAL_SDK)
+
+#include <os/log_private.h>
+
+#endif
+
+WTF_EXTERN_C_BEGIN
+
+OS_EXPORT OS_NOTHROW OS_NOT_TAIL_CALLED OS_NONNULL5
+void os_log_with_args(os_log_t oslog, os_log_type_t type, const char *format, va_list args, void *ret_addr);
+
+WTF_EXTERN_C_END
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to