<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>178276</bug_id>
          
          <creation_ts>2017-10-13 11:49:13 -0700</creation_ts>
          <short_desc>[WPE][GTK] Unify/simplify/improve PAL::logLevelString, WebCore::logLevelString, and WebKit::logLevelString</short_desc>
          <delta_ts>2025-07-09 09:11:39 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Platform</component>
          <version>Other</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>178263</dependson>
    
    <dependson>252558</dependson>
    
    <dependson>295481</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Adrian Perez">aperez</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>annulen</cc>
    
    <cc>cgarcia</cc>
    
    <cc>clopez</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1360136</commentid>
    <comment_count>0</comment_count>
    <who name="Adrian Perez">aperez</who>
    <bug_when>2017-10-13 11:49:13 -0700</bug_when>
    <thetext>We currently have:

 - PAL::logLevelString (Source/WebCore/PAL/pal/unix/LoggingUnix.cpp)
 - WebCore::logLevelString (Source/WebCore/platform/unix/LoggingUnix.cpp)
 - WebKit::logLevelString (Source/WebKit/Platform/unix/LoggingUnix.cpp)

Essentially, the three do the same, which is:

 1. Picking the value from the WEBKIT_DEBUG environment variable.
 2. If the variable is not present, return an empty string.
 3. If the variable is defined:
     3.a. Warn with “WTFLogAlways” that some logging is only available
          in debug builds.
     3.b. Prepend “NotYetImplemented,” to the obtained value (except
          for WebKit::logLevelString).
     3.c. Return the value.

During a discussion with Konstantin Tokarev and Carlos López we came up
with the following possible improvements/doubts:

 - Unifying all of them, by making both WebCore::logLevelString and
   WebKit::logLevelString just call PAL::logLevelString.
 - Removing the message emitted with WTFLogAlways().
 - Does it make sense to always prepend “NotYetImplemented,”? Why was it
   not being done for the WebKit version?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2127916</commentid>
    <comment_count>1</comment_count>
    <who name="Adrian Perez">aperez</who>
    <bug_when>2025-07-04 14:05:58 -0700</bug_when>
    <thetext>(In reply to Adrian Perez from comment #0)
&gt; We currently have:
&gt; 
&gt;  - PAL::logLevelString (Source/WebCore/PAL/pal/unix/LoggingUnix.cpp)

This instance still has some custom code, it should be changed to call WTF::logLevelString() -- read on below.

&gt;  - WebCore::logLevelString (Source/WebCore/platform/unix/LoggingUnix.cpp)
&gt;  - WebKit::logLevelString (Source/WebKit/Platform/unix/LoggingUnix.cpp)

These two instances have been changed to call WTF::logLevelString() in 260601@main 

&gt; Essentially, the three do the same, which is:
&gt; 
&gt;  1. Picking the value from the WEBKIT_DEBUG environment variable.
&gt;  2. If the variable is not present, return an empty string.
&gt;  3. If the variable is defined:
&gt;      3.a. Warn with “WTFLogAlways” that some logging is only available
&gt;           in debug builds.
&gt;      3.b. Prepend “NotYetImplemented,” to the obtained value (except
&gt;           for WebKit::logLevelString).
&gt;      3.c. Return the value.
&gt; 
&gt; During a discussion with Konstantin Tokarev and Carlos López we came up
&gt; with the following possible improvements/doubts:
&gt; 
&gt;  - Unifying all of them, by making both WebCore::logLevelString and
&gt;    WebKit::logLevelString just call PAL::logLevelString.

This was partially done in 260601@main -- except for the PAL one, as outlined above.

&gt;  - Removing the message emitted with WTFLogAlways().
&gt;  - Does it make sense to always prepend “NotYetImplemented,”? Why was it
&gt;    not being done for the WebKit version?

Still no idea about these two.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2127986</commentid>
    <comment_count>2</comment_count>
    <who name="Adrian Perez">aperez</who>
    <bug_when>2025-07-05 14:14:10 -0700</bug_when>
    <thetext>(In reply to Adrian Perez from comment #1)
&gt; (In reply to Adrian Perez from comment #0)
&gt; &gt; We currently have:
&gt; &gt; 
&gt; &gt;  - PAL::logLevelString (Source/WebCore/PAL/pal/unix/LoggingUnix.cpp)
&gt; 
&gt; This instance still has some custom code, it should be changed to call
&gt; WTF::logLevelString() -- read on below.

Actually, nothing seems to call PAL::logLevelString() presently. I am looking into removing it in bug #295481

&gt; &gt;  - WebCore::logLevelString (Source/WebCore/platform/unix/LoggingUnix.cpp)
&gt; &gt;  - WebKit::logLevelString (Source/WebKit/Platform/unix/LoggingUnix.cpp)
&gt; 
&gt; These two instances have been changed to call WTF::logLevelString() in
&gt; 260601@main 

And because those two have been simplified already, once the patch for #295481 lands, we can close this one as well.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2128710</commentid>
    <comment_count>3</comment_count>
    <who name="Adrian Perez">aperez</who>
    <bug_when>2025-07-09 09:11:39 -0700</bug_when>
    <thetext>(In reply to Adrian Perez from comment #2)
&gt; (In reply to Adrian Perez from comment #1)
&gt; &gt; (In reply to Adrian Perez from comment #0)
&gt; &gt; &gt; We currently have:
&gt; &gt; &gt; 
&gt; &gt; &gt;  - PAL::logLevelString (Source/WebCore/PAL/pal/unix/LoggingUnix.cpp)
&gt; &gt; 
&gt; &gt; This instance still has some custom code, it should be changed to call
&gt; &gt; WTF::logLevelString() -- read on below.
&gt; 
&gt; Actually, nothing seems to call PAL::logLevelString() presently. I am
&gt; looking into removing it in bug #295481

The patch for that landed, so I think we can consider this issue solved.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>