const int VlogInfo::kDefaultVlogLevel = 0;
to -1.
I'm seeing a few instances of DVLOG(0) in the codebase, and they seem to spam the console of any debug builds, similar to DLOG(INFO).We no longer seem to allow DLOG(INFO) thanks to a presubmit case - is DVLOG(0) useful in some case that DLOG(INFO) isn't?
--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
On Mon, Dec 2, 2013 at 10:47 AM, Ami Fischman <fisc...@chromium.org> wrote:
I think several people (myself among them) assumed that [D]VLOG(0) wouldn't print unless extra flags were passed, thus 322805 and friends converting LOG(INFO) to VLOG(0). It's hilarious that VLOG(0)==LOG(INFO).
FWIW, I've always asked people to convert to VLOG(1) instead of VLOG(0) -- sorry I missed that people were doing the latter this time.I think rather than change the default log level from 0 to -1 we should just fix VLOG(0)s to be VLOG(1)s.PK
I think several people (myself among them) assumed that [D]VLOG(0) wouldn't print unless extra flags were passed, thus 322805 and friends converting LOG(INFO) to VLOG(0). It's hilarious that VLOG(0)==LOG(INFO).
Change all LOG(INFO) and VLOG(0) to VLOG(1). This costs 10s (100s?) of bytes per LOG(INFO) changed.
Well, looking closer it seems we don't use the LOG(INFO)-specific constructor so about 10-20bytes/callsite of that cost is already lost (google3's logging with almost the same constructor signatures claims 17bytes/callsite).Still, the non-inlined part of VLOG_IS_ON has two more arguments than that of LOG_IS_ON.
On Mon, Dec 2, 2013 at 2:45 PM, Chris Hopman <cjho...@chromium.org> wrote:
Well, looking closer it seems we don't use the LOG(INFO)-specific constructor so about 10-20bytes/callsite of that cost is already lost (google3's logging with almost the same constructor signatures claims 17bytes/callsite).Still, the non-inlined part of VLOG_IS_ON has two more arguments than that of LOG_IS_ON.The actual effect of two more args is not obvious to me, but seems likely to be small.
More importantly, logging in general is already strongly discouraged across Chrome due (among several other reasons) to the binary size cost of the actual log message. It seems like the additional cost of a VLOG constructor over a LOG one is not terribly important given that, in general, LOG messages should be extremely rare.
Or to say this a different way: the best fix for these issues is often not to convert LOG(INFO) and VLOG(0) to VLOG(1), but to delete the log statements completely.
Solution 1.1:
Add presubmit check for uses of LOG(INFO) and VLOG(0).
More importantly, logging in general is already strongly discouraged across Chrome due (among several other reasons) to the binary size cost of the actual log message. It seems like the additional cost of a VLOG constructor over a LOG one is not terribly important given that, in general, LOG messages should be extremely rare.Is this strong discouragement something new? If not, then I don't know that we can expect it to be a solution going forward when it's not been a solution to this point.
On Mon, Dec 2, 2013 at 2:49 PM, Peter Kasting <pkas...@chromium.org> wrote:
On Mon, Dec 2, 2013 at 2:45 PM, Chris Hopman <cjho...@chromium.org> wrote:
Well, looking closer it seems we don't use the LOG(INFO)-specific constructor so about 10-20bytes/callsite of that cost is already lost (google3's logging with almost the same constructor signatures claims 17bytes/callsite).Still, the non-inlined part of VLOG_IS_ON has two more arguments than that of LOG_IS_ON.The actual effect of two more args is not obvious to me, but seems likely to be small.It's not obvious to me either, but the 17bytes/callsite in the constructor is, basically, from one additional arg.Still, I, too, don't worry too much about a couple bytes extra overhead (switching to ninja cost something like 6 extra bytes per LOG call, I believe).
Feel free to remove that from the Solution 1 list and add one of the below that I missed:Solution 1.1:Add presubmit check for uses of LOG(INFO) and VLOG(0).orSolution 1.2:Discourage use of LOG(INFO) and VLOG(0) in code reviews, probably inconsistently.More importantly, logging in general is already strongly discouraged across Chrome due (among several other reasons) to the binary size cost of the actual log message. It seems like the additional cost of a VLOG constructor over a LOG one is not terribly important given that, in general, LOG messages should be extremely rare.Is this strong discouragement something new? If not, then I don't know that we can expect it to be a solution going forward when it's not been a solution to this point.Or to say this a different way: the best fix for these issues is often not to convert LOG(INFO) and VLOG(0) to VLOG(1), but to delete the log statements completely.Sure, that works to clean up the current state. It doesn't address future changes though.
Sorry to resurrect this old thread. Did anything ever actually happen to prevent people from using VLOG(0) or DVLOG(0)? We still have hundreds of uses of these across the codebase, and it seems like the authors expected this to cause the log to not be printed by default. Is there a presubmit check now, but we haven't cleaned up the old cases? Or did the change just never happen?