Especially if it's impacting users, I'm willing to temporarily undo
the default level change.
Or something like change it for official builds (I didn't really think
about it too hard).
What do you think?
> I have a set of changes locally, which I'll be working to check in, which
> globally convert LOG(INFO) to VLOG(1).
Thank you so much for doing this!
-- Dirk
On Fri, Oct 15, 2010 at 3:31 PM, Peter Kasting <pkas...@google.com> wrote:
> --
> Chromium Developers mailing list: chromi...@chromium.org
> View archives, change email options, or unsubscribe:
> http://groups.google.com/a/chromium.org/group/chromium-dev
>
On Fri, Oct 15, 2010 at 3:31 PM, Peter Kasting <pkas...@google.com> wrote:Especially if it's impacting users, I'm willing to temporarily undo
> This has become a serious issue recently as we've changed the default LOG
> level to INFO. Now Chrome builds are much noisier. This is at least
> annoying, and in some cases worse as some users have reported slowdowns due
> to console log spam.
the default level change.
Or something like change it for official builds (I didn't really think
about it too hard).
What do you think?
--
No, it operates only on basename minus extension (ignoring -inl).
This matches the google-glog behavior. Is there a need for
directory-based matching? I can think about adding support for it,
but I'm hesitant to diverge from google-glog behavior even more.
On Sat, Oct 23, 2010 at 2:56 PM, Fred Akalin <aka...@chromium.org> wrote:No, it operates only on basename minus extension (ignoring -inl).
This matches the google-glog behavior. Is there a need for
directory-based matching? I can think about adding support for it,
but I'm hesitant to diverge from google-glog behavior even more.I suggest not adding things until we have explicitly found we need them (i.e. not just because we could imagine using them in the future).
PK--
Now that we have VLOG(), I think it would be reasonable to add
LOG(INFO) use back, and expect developers to justify use of LOG(INFO)
instead of VLOG(). It might also be reasonable to expect an
associated bug if you want to check verbose LOG(INFO) into the tree.
That would provide a slight brake on egregious use of LOG(INFO), and
presumably when the bug is fixed the LOG(INFO) lines can be removed.
Another idea was to require an email address so that readers know who
to ask.
Basically, I think the goal should be not to have a bunch of logging
lines just because they are imagined to be cheap and they might be
useful "someday".
-scott
This is very similar to optimization, where you should keep it simple
until you've determined that you actually do need something more
clever (and probably harder to understand and debug). Likewise, don't
check always-on log lines into the codebase until you're actually
debugging something using binaries you did not build, and once you do
tie it to a specific project (which will hopefully someday be
completed) rather than just letting it hang out forever.
If I sound like a crank on this, it's because in my experience log
output grows exponentially unless it is actively fought. Tragedy of
the commons and all.
-scott
+1. Logging with some concept of zones is very powerful and extremely useful. Windows has had ETW (http://msdn.microsoft.com/en-us/magazine/cc163437.aspx) for years which basically allowed you to specify logging providers and allow consumers to listen to events from a specific provider (Using ETW in conjunction with WPP (http://msdn.microsoft.com/en-us/library/ff556204.aspx) is especially powerful and low-cost). VLOG essentially provides some concept of a zone but the zone is restricted to the file name which may not be suffient in many cases.I also disagree with the statement that verbose logging is because of an inability to use a debugger (I have many limitations but I think I can say with some confidence that the inability to use a debugger is not one of them). Debugging is what I do on my desktop, logging is what I expect the software to do at an end-user's machine. There are a myriad reasons in client software why an issue may only happen on a specific (or a specific set of) end-user machine(s) (this is unlike what Google3 has to deal with). ETW is used extensively and verbosely in the operating system and this is not because Dave Cutler and his team cannot use a debugger. If there are no listeners for a specific provider the cost is low.I also agree with the comment about setting the default reporting level to errors or warnings for stable releases. In the absence of WPP this is how we lower the cost of logging at run-time. I disagree that the way to reduce cost is to reduce the amount of logging.
On Tue, Oct 26, 2010 at 9:25 AM, Sanjeev Radhakrishnan <sanj...@chromium.org> wrote:+1. Logging with some concept of zones is very powerful and extremely useful. Windows has had ETW (http://msdn.microsoft.com/en-us/magazine/cc163437.aspx) for years which basically allowed you to specify logging providers and allow consumers to listen to events from a specific provider (Using ETW in conjunction with WPP (http://msdn.microsoft.com/en-us/library/ff556204.aspx) is especially powerful and low-cost). VLOG essentially provides some concept of a zone but the zone is restricted to the file name which may not be suffient in many cases.I also disagree with the statement that verbose logging is because of an inability to use a debugger (I have many limitations but I think I can say with some confidence that the inability to use a debugger is not one of them). Debugging is what I do on my desktop, logging is what I expect the software to do at an end-user's machine. There are a myriad reasons in client software why an issue may only happen on a specific (or a specific set of) end-user machine(s) (this is unlike what Google3 has to deal with). ETW is used extensively and verbosely in the operating system and this is not because Dave Cutler and his team cannot use a debugger. If there are no listeners for a specific provider the cost is low.I also agree with the comment about setting the default reporting level to errors or warnings for stable releases. In the absence of WPP this is how we lower the cost of logging at run-time. I disagree that the way to reduce cost is to reduce the amount of logging.Note, at runtime in release builds logging is disabled globally unless the user runs with --enable-logging. In other words, the runtime cost is not really an issue for end users. So, the default log level is not really that interesting in that context.
I think logging zones would be interesting, because you could perhaps
tie a zone to a bug or email address for purposes of suggesting that
maybe the log lines could be removed.
-scott
On Tue, Oct 26, 2010 at 8:05 AM, Darin Fisher <da...@chromium.org> wrote:
The original problem was that LOG(INFO) was too cluttered to be
useful, for the reasons Scott mentioned. The clutter arose from the
lack of any logging level "lower" than LOG(INFO); I think if VLOG()
existed from the start and developers knew about it, they would have
used it instead of LOG(INFO) for the debugging-related messages (e.g.,
"Module foo initialized"). Now that VLOG() is implemented, ideally
we'd reevaluate all the LOG(INFO)s to see if they would have been
VLOG()s in the first place, or if they truly are generally
informative. Given that that would take much too long, and that it
seems to me that most of the LOG(INFO)s should have been VLOG()s, the
most practical solution would be to convert all LOG(INFO)s to VLOG(1)s
(once) and let people convert back to LOG(INFO) if they feel it's
necessary (which I think would be rare). Going forward, I trust that
Chromium developers will use their best judgment as to the best
logging level for any new logs, assuming that everyone knows about
VLOG() (and --vmodule).
I don't understand how this argument is ChromeOS-specific. There are
certainly cases in Chrome when bugs are hard to reproduce, and only
logs help, and the problem is general enough that you want all logging
to be turned on. In that case, --v=1 would work too, but I don't
think it should be the default for Chrome.
Is there a need for
directory-based matching? I can think about adding support for it,
but I'm hesitant to diverge from google-glog behavior even more.
The functionality of vlog as it stands today is that it looks at the file name and it is pretty granular. It is possible to modify vlog to look at the entire filepath.But thinking more about this an approach like the following would be better. This could retain the finer granularity at the same time provide area wise logging levels. The API signature is:LOG(ZONE, severity, logmessage);
I'm explicitlyadvocating for a single switch instead of vmodule and vpath.
One idea is to change the semantics of vmodule (and maybe rename it)
so that if a pattern contains a slash, it'll match based on the entire
filename instead of just the module (basename minus extension minus
-inl). For example:
--vmodule=browser_process*=2,*/chromeos/*=1
would mean that filenames that start with "browser_process" will get a
vlog level of 2, and paths containing "/chromeos/" (e.g.,
chrome/browser/chromeos, chrome/test/chromeos) would get a vlog level
of 1.
This may be what you're already suggesting, but I'm explicitly
advocating for a single switch instead of vmodule and vpath.
Thoughts?
This has been implemented and checked in as @63436. Basically, if a
--vmodule pattern has a slash*, it will try to match the entire path
against it instead of just the module name. Note that this means
you'll almost always need to use wildcards for directory patterns,
e.g. --vmodule=*/chromeos/*=2,*chrome/browser/sync*=3.
* forward or back slash, but it must match your current platform --
I'll fix this in a future CL