Bug 185704 - [Cocoa] Consider renaming and only default enabling release logging in Production builds; make release logging opt-in for Debug and Release builds
Summary: [Cocoa] Consider renaming and only default enabling release logging in Produc...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-16 16:49 PDT by Daniel Bates
Modified: 2018-05-24 15:54 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Bates 2018-05-16 16:49:03 PDT
Every time I use Xcode to debug an issue I am greeted with a wall of log messages of the form:

[[
2018-05-16 15:07:43.819732-0700 MiniBrowser[29659:9188375] [Network] 0x1242f5000 - DocumentLoader::startLoadingMainResource: Returning empty document (frame = 0x11f5e7440, main = 1)
2018-05-16 15:07:43.819976-0700 MiniBrowser[29659:9188375] [PerformanceLogging] Memory usage info dump at MainFrameLoadCompleted:
]]

It seems excessive to enable such logging by default for Debug and Release built WebKit. I can see the benefit for such logging for Production builds to help diagnose hard to debug issues in customer installs. Therefore I propose that we enable such logging by default only for Production builds. For all other builds we should disable such logging by default and require a person to explicitly opt-in to such logging if desired. We may also want to consider renaming the RELEASE_LOG*() functions to better reflect their primary purpose to help diagnose hard to debug issues in customer installs.

Additional remarks:

The compile-time option RELEASE_LOG_DISABLED controls whether such release logging is enabled. Such logging is made using the macro functions RELEASE_LOG*(). To clarify, the term "release" is a reference to logging that we want to appear in customer logs for shipped ("release"d) software and is not to be confused with the Xcode build configuration type of the same name (Release). Unless RELEASE_LOG_DISABLED is explicitly defined to be false, RELEASE_LOG_DISABLED is set to the value of !(USE(OS_LOG)) [1]; => RELEASE_LOG*() logs a message on iOS and macOS (by [2]) regardless of the Xcode build configuration WebKit was built with. 

[1] <https://trac.webkit.org/browser/trunk/Source/WTF/wtf/Assertions.h?rev=231130#L102>
[2] <https://trac.webkit.org/browser/trunk/Source/WTF/wtf/Platform.h?rev=231743#L1267>