Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(163)

Issue 2954883002: Add dvlog_always_on to enable DVLOG without DEBUG and DCHECK option

Created:
3 years, 5 months ago by hiroh
Modified:
3 years, 5 months ago
CC:
chromium-reviews, cbentzel+watch_chromium.org, sadrul, yusukes+watch_chromium.org, vmpstr+watch_chromium.org, binji+watch_chromium.org, tzik, net-reviews_chromium.org, bnc+watch_chromium.org, teravest+watch_chromium.org, bradnelson+warch_chromium.org, piman+watch_chromium.org, danakj+watch_chromium.org, ihf+watch_chromium.org, Pawel Osciak, dcheng
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Add dvlog_always_on to enable DVLOG without DEBUG and DCHECK option dvlog_always_on make DLOG() and DVLOG() enable without DEBUG and DCHECK option. This is useful because dvlog_always_on does not enable DCHECK(), and therefore, the program is not failed due to DCHECK(). BUG=None Test=Seeing DVLOGs and DLOGs are shown.

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+53 lines, -10 lines) Patch
M base/BUILD.gn View 2 chunks +4 lines, -0 lines 0 comments Download
M base/logging.h View 3 chunks +9 lines, -3 lines 0 comments Download
M base/logging_unittest.cc View 4 chunks +16 lines, -3 lines 0 comments Download
M base/message_loop/incoming_task_queue.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M build/config/BUILD.gn View 2 chunks +4 lines, -0 lines 0 comments Download
A build/config/dvlog_always_on.gni View 1 chunk +8 lines, -0 lines 0 comments Download
M net/spdy/core/hpack/hpack_huffman_decoder.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M ppapi/cpp/logging.h View 2 chunks +8 lines, -0 lines 0 comments Download

Messages

Total messages: 27 (3 generated)
hiroh
This patch have to be merged after a patch for WebKit (crrev.com/2954873002) is merged.
3 years, 5 months ago (2017-06-26 05:23:39 UTC) #2
hiroh
Please first approve the idea of dvlog_always_on . That is the first step to add ...
3 years, 5 months ago (2017-06-26 06:22:54 UTC) #3
brettw
I can understand that you and one or two other people might use this right ...
3 years, 5 months ago (2017-06-26 18:21:20 UTC) #4
Pawel Osciak
On 2017/06/26 18:21:20, brettw wrote: > I can understand that you and one or two ...
3 years, 5 months ago (2017-06-27 01:07:10 UTC) #5
brettw
+Dirk who was asking me about this. Can you be more specific about where you ...
3 years, 5 months ago (2017-06-27 01:48:04 UTC) #7
Pawel Osciak
On 2017/06/27 01:48:04, brettw wrote: > +Dirk who was asking me about this. Can you ...
3 years, 5 months ago (2017-06-27 07:47:27 UTC) #8
danakj
On Mon, Jun 26, 2017 at 9:07 PM, <posciak@chromium.org> wrote: > On 2017/06/26 18:21:20, brettw ...
3 years, 5 months ago (2017-06-27 16:17:36 UTC) #9
Dirk Pranke
I have no desire to run builds in the Chromium CQ that have DVLOG enabled ...
3 years, 5 months ago (2017-06-30 00:37:22 UTC) #10
Pawel Osciak
On 2017/06/27 16:17:36, danakj wrote: > On Mon, Jun 26, 2017 at 9:07 PM, <mailto:posciak@chromium.org> ...
3 years, 5 months ago (2017-06-30 04:12:33 UTC) #11
Pawel Osciak
On 2017/06/30 00:37:22, Dirk Pranke wrote: > I have no desire to run builds in ...
3 years, 5 months ago (2017-06-30 04:35:14 UTC) #12
danakj
On Fri, Jun 30, 2017 at 12:35 AM, <posciak@chromium.org> wrote: > On 2017/06/30 00:37:22, Dirk ...
3 years, 5 months ago (2017-07-04 16:30:32 UTC) #14
Wez
We decided against the Dump-on-DCHECK approach, but we're instead working on a DCHECKs-in-ASAN alternative that ...
3 years, 5 months ago (2017-07-05 18:36:42 UTC) #15
danakj
On Wed, Jul 5, 2017 at 2:36 PM, Wez <wez@chromium.org> wrote: > We decided against ...
3 years, 5 months ago (2017-07-05 18:50:10 UTC) #16
Wez
OK, I'll break out a fresh CL with dcheck_mode; default will be LOG_DCHECK=LOG_FATAL, so we ...
3 years, 5 months ago (2017-07-05 18:53:53 UTC) #17
Wez
Ah, one down-side to this: death-tests will tend to bit-rot if we don't have a ...
3 years, 5 months ago (2017-07-05 21:04:09 UTC) #18
danakj
On Wed, Jul 5, 2017 at 5:04 PM, Wez <wez@chromium.org> wrote: > Ah, one down-side ...
3 years, 5 months ago (2017-07-05 21:07:18 UTC) #19
Wez
Right; so the risk is that people add more death-tests, or alter existing death-tests. We ...
3 years, 5 months ago (2017-07-05 21:15:04 UTC) #20
danakj
On Wed, Jul 5, 2017 at 5:15 PM, Wez <wez@chromium.org> wrote: > Right; so the ...
3 years, 5 months ago (2017-07-05 21:25:36 UTC) #21
Wez
+cc:dcheng, who I mentioned this to, and who expressed a preference for treating DVLOG separately ...
3 years, 5 months ago (2017-07-06 01:39:25 UTC) #22
Dirk Pranke
I think I can probably live with whatever we come up with here. Ultimately my ...
3 years, 5 months ago (2017-07-06 20:45:02 UTC) #23
dcheng1
On 2017/07/06 01:39:25, Wez wrote: > +cc:dcheng, who I mentioned this to, and who expressed ...
3 years, 5 months ago (2017-07-12 09:25:41 UTC) #24
danakj
On Wed, Jul 12, 2017 at 5:25 AM, <dcheng@google.com> wrote: > On 2017/07/06 01:39:25, Wez ...
3 years, 5 months ago (2017-07-12 15:55:54 UTC) #25
brettw
Also keep in mind that DCHECK is really DLOG_IF(FATAL...). Although in Chrome we don't usually ...
3 years, 5 months ago (2017-07-12 19:29:20 UTC) #26
Wez
3 years, 5 months ago (2017-07-12 20:47:59 UTC) #27
On 2017/07/12 19:29:20, brettw wrote:
> Also keep in mind that DCHECK is really DLOG_IF(FATAL...). Although in Chrome
we
> don't usually use it this way, I think internal to Google there's more use of
> the log levels.

It's actually not quite DLOG_IF(FATAL, ...) - DCHECK(condition) guarantees to
"reference" |condition|, so you can write:

bool success = DoStuff();
DCHECK(success)

whereas DLOG_IF() does not - the example above would fail to build for Release,
with an unused variable warning->error.

You're right, though, that at present the LogSeverity of DCHECK is FATAL in
DCHECK_IS_ON() builds.  If we go with the debug_mode build option to allow
DCHECK to be non-FATAL then that won't affect DLOG*(FATAL, ...) since those
lines are explicitly choosing FATAL.  We would necessarily have a new LOG_DCHECK
LogSeverity, though, so it would be possible to write DLOG*(DCHECK, ...) to get
same-as-DCHECK LogSeverity.

My preference is still to implement the debug_mode flag - since it seems
controversial I'll write up a quick Chromium.org doc on it for base/OWNERS to
argue over.

Powered by Google App Engine
This is Rietveld 408576698