Bug 178276 - [WPE][GTK] Unify/simplify/improve PAL::logLevelString, WebCore::logLevelString, and WebKit::logLevelString
Summary: [WPE][GTK] Unify/simplify/improve PAL::logLevelString, WebCore::logLevelStrin...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on: 178263
Blocks:
  Show dependency treegraph
 
Reported: 2017-10-13 11:49 PDT by Adrian Perez
Modified: 2017-10-13 11:49 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adrian Perez 2017-10-13 11:49:13 PDT
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?