This is incredible - thank you for pushing this through Eric!

In case the implications of this aren't clear to anyone: One big difficulty
with debugging intermittent failures is that enabling logging for the
relevant components can often be too expensive for a try run. The logs can
consume hundreds of megabytes, and quickly hit the TreeHerder limits (at
which point you get nothing). We have the ability to record and upload a
log as a separate artifact, but that's rarely useful because it's difficult
to correlate the NSPR log output with the TestRunner spew in the other file.

When I was working on media stability, I debugged dozens of race conditions
by adding hacky instrumentation to make PR_LOG invoke printf if a certain
script-accessible bit was set, and then retriggering on try until the
failure occurred. This work will make that much more straightforward to do.

Eric, is there an option to make the NSPR log output go directly into the
regular test output?

On Fri, Jan 8, 2016 at 5:32 PM, Eric Rahm <er...@mozilla.com> wrote:

> Hi Folks-
>
> With bug 1233881 <https://bugzilla.mozilla.org/show_bug.cgi?id=1233881> we
> landed the ability turn on logging via prefs.
>
> Lets say you have a log module "Foo", if you add a "logging.Foo" pref and
> set it to "Debug" you will now see all output from the Foo log module that
> is of Debug and higher importance.
>
> Why is this so cool? Well now you don't need to restart your browser to
> enable logging [1]. You also don't have to set env vars to enable logging
> [2].
>
> There is one caveat: if you don't use LazyLogModule and friends, you don't
> get dynamic logging. So go update your loggers!
>
> -e
>
> [1] Okay, this only kind of works right now. You'll still need to set
> NSPR_LOG_MODULES="anything_you_want" to see output. Bug 1174972
> <https://bugzilla.mozilla.org/show_bug.cgi?id=1174972> will fix this.
>
> [2] If you care about messages during startup you will still need to set
> the NSPR_LOG_MODULES env var. Unfortunately it takes time to load the pref
> system, and then more time to load your profile.
> _______________________________________________
> dev-platform mailing list
> dev-platform@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-platform
>
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to