Bug 160768 - Rename LOG_ALWAYS
Summary: Rename LOG_ALWAYS
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Template Framework (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Keith Rollin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-11 10:30 PDT by Keith Rollin
Modified: 2016-08-15 12:01 PDT (History)
6 users (show)

See Also:


Attachments
Patch (58.86 KB, patch)
2016-08-11 16:30 PDT, Keith Rollin
no flags Details | Formatted Diff | Diff
Patch (60.86 KB, patch)
2016-08-12 17:44 PDT, Keith Rollin
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Keith Rollin 2016-08-11 10:30:37 PDT
LOG_ALWAYS and friends should be renamed, given that the first parameter to it is a boolean expression that determines whether or not logging should be performed.

The macros are changed as follows:

LOG_ALWAYS(bool, format, ...) -> LOG_IF(bool, format, ...)
LOG_ALWAYS_ERROR(bool, format, ...) -> LOG_ERROR_IF(bool, format, ...)

The following macros are added:

LOG_ALWAYS(format, ...)
LOG_ERROR_ALWAYS(format, ...)

The sites calling these macros are also updated. Macros like:

#define DOWNLOAD_LOG_ALWAYS(...) LOG_ALWAYS(isAlwaysOnLoggingAllowed(), __VA_ARGS__)
#define DOWNLOAD_LOG_ALWAYS_ERROR(...) LOG_ALWAYS_ERROR(isAlwaysOnLoggingAllowed(), __VA_ARGS__)

are changed to:

#define LOG_IF_ALLOWED(...) LOG_IF(isAlwaysOnLoggingAllowed(), __VA_ARGS__)
#define LOG_ERROR_IF_ALLOWED(...) LOG_ERROR_IF(isAlwaysOnLoggingAllowed(), __VA_ARGS__)

Thus, instead of having file-specific macros for conditional logging, we have uniformly named macros. This relieves the developer from trying to remember while macros to be used for the specific file they're working in.
Comment 1 Keith Rollin 2016-08-11 16:30:58 PDT
Created attachment 285865 [details]
Patch
Comment 2 Keith Rollin 2016-08-12 16:51:16 PDT
Gavin suggests macro names following the pattern RELEASE_LOG_*. Updating my changes accordingly.
Comment 3 Keith Rollin 2016-08-12 17:44:09 PDT
Created attachment 285985 [details]
Patch
Comment 4 WebKit Commit Bot 2016-08-15 12:01:31 PDT
Comment on attachment 285985 [details]
Patch

Clearing flags on attachment: 285985

Committed r204472: <http://trac.webkit.org/changeset/204472>
Comment 5 WebKit Commit Bot 2016-08-15 12:01:35 PDT
All reviewed patches have been landed.  Closing bug.