Bug 224959 - Add `ALWAYS_LOG_WITH_STREAM` macro for easier development/debugging
Summary: Add `ALWAYS_LOG_WITH_STREAM` macro for easier development/debugging
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Devin Rousso
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-04-22 17:00 PDT by Devin Rousso
Modified: 2021-04-25 14:46 PDT (History)
11 users (show)

See Also:


Attachments
Patch (10.82 KB, patch)
2021-04-22 17:04 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Devin Rousso 2021-04-22 17:00:29 PDT
It's often very helpful to use existing `operator<<` defined on objects, but annoying to have to copypaste the boilerplate code that creates a `WTF::TextStream` and uses it in a `WTFLogAlways` or wait for a debug build to enable existing `LOG_WITH_STREAM`.
Comment 1 Devin Rousso 2021-04-22 17:04:29 PDT
Created attachment 426867 [details]
Patch
Comment 2 Devin Rousso 2021-04-22 17:06:02 PDT
Comment on attachment 426867 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=426867&action=review

> Source/WTF/wtf/Assertions.h:592
> +#define ALWAYS_LOG_WITH_STREAM(commands) do { \

I'd love to add an `ALWAYS_LOG` and `ALWAYS_LOG_IF` as well, but those are both already defined in `wtf/LoggerHelper.h`.

Maybe I should rename this to `WTF_ALWAYS_LOG_WITH_STREAM` instead so that I can add those without worrying about a name conflict?
Comment 3 EWS 2021-04-25 14:45:58 PDT
Committed r276574 (237010@main): <https://commits.webkit.org/237010@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 426867 [details].
Comment 4 Radar WebKit Bug Importer 2021-04-25 14:46:16 PDT
<rdar://problem/77127701>