Title: [223296] trunk/Source/WebCore/PAL
- Revision
- 223296
- Author
- ape...@igalia.com
- Date
- 2017-10-13 12:04:24 -0700 (Fri, 13 Oct 2017)
Log Message
[WPE][GTK] Provide an implementation of PAL::logLevelString()
https://bugs.webkit.org/show_bug.cgi?id=178263
Reviewed by Carlos Alberto Lopez Perez.
Provide an implementation of PAL::logLevelString() which picks the value from the
WEBCORE_DEBUG environment variable. Logging of notImplemented() calls is always enabled,
which is the same behavior as in WebCore::logLevelString().
* pal/PlatformGTK.cmake: Add LoggingUnix.cpp to the list of sources.
* pal/PlatformWPE.cmake: Add LoggingUnix.cpp to the list of sources.
* pal/unix/LoggingUnix.cpp: Added.
(PAL::logLevelString):
Modified Paths
Added Paths
Diff
Modified: trunk/Source/WebCore/PAL/ChangeLog (223295 => 223296)
--- trunk/Source/WebCore/PAL/ChangeLog 2017-10-13 18:55:39 UTC (rev 223295)
+++ trunk/Source/WebCore/PAL/ChangeLog 2017-10-13 19:04:24 UTC (rev 223296)
@@ -1,3 +1,19 @@
+2017-10-13 Adrian Perez de Castro <ape...@igalia.com>
+
+ [WPE][GTK] Provide an implementation of PAL::logLevelString()
+ https://bugs.webkit.org/show_bug.cgi?id=178263
+
+ Reviewed by Carlos Alberto Lopez Perez.
+
+ Provide an implementation of PAL::logLevelString() which picks the value from the
+ WEBCORE_DEBUG environment variable. Logging of notImplemented() calls is always enabled,
+ which is the same behavior as in WebCore::logLevelString().
+
+ * pal/PlatformGTK.cmake: Add LoggingUnix.cpp to the list of sources.
+ * pal/PlatformWPE.cmake: Add LoggingUnix.cpp to the list of sources.
+ * pal/unix/LoggingUnix.cpp: Added.
+ (PAL::logLevelString):
+
2017-10-13 Jer Noble <jer.no...@apple.com>
Unreviewed build fix; add definitions for IOSurface methods missing on some platforms.
Modified: trunk/Source/WebCore/PAL/pal/PlatformGTK.cmake (223295 => 223296)
--- trunk/Source/WebCore/PAL/pal/PlatformGTK.cmake 2017-10-13 18:55:39 UTC (rev 223295)
+++ trunk/Source/WebCore/PAL/pal/PlatformGTK.cmake 2017-10-13 19:04:24 UTC (rev 223296)
@@ -6,6 +6,8 @@
system/gtk/SoundGtk.cpp
text/KillRing.cpp
+
+ unix/LoggingUnix.cpp
)
if (ENABLE_SUBTLE_CRYPTO)
Modified: trunk/Source/WebCore/PAL/pal/PlatformWPE.cmake (223295 => 223296)
--- trunk/Source/WebCore/PAL/pal/PlatformWPE.cmake 2017-10-13 18:55:39 UTC (rev 223295)
+++ trunk/Source/WebCore/PAL/pal/PlatformWPE.cmake 2017-10-13 19:04:24 UTC (rev 223296)
@@ -5,6 +5,8 @@
system/Sound.cpp
text/KillRing.cpp
+
+ unix/LoggingUnix.cpp
)
if (ENABLE_SUBTLE_CRYPTO)
Added: trunk/Source/WebCore/PAL/pal/unix/LoggingUnix.cpp (0 => 223296)
--- trunk/Source/WebCore/PAL/pal/unix/LoggingUnix.cpp (rev 0)
+++ trunk/Source/WebCore/PAL/pal/unix/LoggingUnix.cpp 2017-10-13 19:04:24 UTC (rev 223296)
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2017, Igalia S.L. 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. ``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
+ * 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.
+ */
+
+#include "config.h"
+#include "Logging.h"
+
+#include <wtf/text/WTFString.h>
+
+#if !LOG_DISABLED || !RELEASE_LOG_DISABLED
+
+namespace PAL {
+
+String logLevelString()
+{
+ if (char* logEnv = getenv("WEBKIT_DEBUG")) {
+
+#if defined(NDEBUG)
+ WTFLogAlways("WEBCORE_DEBUG is not empty, but this is a release build. Notice that many log messages will only appear in a debug build.");
+#endif
+
+ // To disable logging notImplemented set the DISABLE_NI_WARNING environment variable to 1.
+ return ASCIILiteral("NotYetImplemented,") + String(logEnv);
+ }
+
+ return String();
+}
+
+} // namespace PAL
+
+#endif // !LOG_DISABLED || !RELEASE_LOG_DISABLED
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes