Re: Dynamic Logging

2016-01-25 Thread Honza Bambas
Nice idea although unfortunately incomplete.  On Windows this has no 
effect at all.  We cannot use it for common users.  When you set the 
pref, it logs only to the debug output that can be captured only with 
visual studio or similar software being attached.  Not something to ask 
for a common user.


We also need to figure out how to start writing to a file w/o a 
restart.  I believe a harder part of this effort...


-hb-


On 1/9/2016 2:32, Eric Rahm 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


Re: Dynamic Logging

2016-01-25 Thread Eric Rahm
On Monday, January 25, 2016 at 11:06:15 AM UTC-8, Honza Bambas wrote:
> Nice idea although unfortunately incomplete.  On Windows this has no 
> effect at all.  We cannot use it for common users.  When you set the 
> pref, it logs only to the debug output that can be captured only with 
> visual studio or similar software being attached.  Not something to ask 
> for a common user.

I'm reasonably sure it logs to stderr, if there is an issue in the Windows 
implementation please file a bug and we'll get it fixed.

> We also need to figure out how to start writing to a file w/o a 
> restart.  I believe a harder part of this effort...

Valentin has a patch for dynamically specifying a log file in bug 1239686.

-e
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: Dynamic Logging

2016-01-11 Thread Eric Rahm
By default we use |printf_stderr|, which prints to stderr (or logcat on
android/b2g). I presume we grab that in the test logs, but maybe I'm
mistaken?

-e

On Fri, Jan 8, 2016 at 6:32 PM, Bobby Holley <bobbyhol...@gmail.com> wrote:

> 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


Re: Dynamic Logging

2016-01-11 Thread Brian Grinstead

> On Jan 8, 2016, at 5:50 PM, Mike Hommey <m...@glandium.org> wrote:
> 
> On Fri, Jan 08, 2016 at 05:32:48PM -0800, Eric Rahm 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!
> 
> I now wish we had the same for the three or so different logging systems
> in use in javascript.

By the way, with Console.jsm you can do something similar:

  let {ConsoleAPI} = Cu.import("resource://gre/modules/Console.jsm", {});
  let console = new ConsoleAPI({
maxLogLevelPref: "myPref.loglevel",
  });
  console.log(“Message”);

The UITour code does this, and sets it’s log level pref to “error” by default 
so only console.error messages will be shown.  Then you can flip that pref to 
“all” or “log” at runtime to enable logging for that module. 

Brian
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: Dynamic Logging

2016-01-11 Thread Bobby Holley
Yes, printf_stderr is generally the most sure-fire way to get something in
the log IME. Sounds great!

On Mon, Jan 11, 2016 at 11:02 AM, Eric Rahm <er...@mozilla.com> wrote:

> By default we use |printf_stderr|, which prints to stderr (or logcat on
> android/b2g). I presume we grab that in the test logs, but maybe I'm
> mistaken?
>
> -e
>
>
> On Fri, Jan 8, 2016 at 6:32 PM, Bobby Holley <bobbyhol...@gmail.com>
> wrote:
>
>> 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


Re: Dynamic Logging

2016-01-09 Thread Andreas Tolfsen
On 9 January 2016 at 04:06, Philip Chee <philip.c...@gmail.com> wrote:
> On 09/01/2016 09:50, Mike Hommey wrote:
>> On Fri, Jan 08, 2016 at 05:32:48PM -0800, Eric Rahm wrote:
>>> There is one caveat: if you don't use LazyLogModule and friends,
>>> you don't get dynamic logging. So go update your loggers!
>>
>> I now wish we had the same for the three or so different logging
>> systems in use in javascript.
>
> I think the Thunderbird version of log4moz supports using logging prefs
> in this way since forever. So it's now down to two?

Does this work with toolkit/modules/Log.jsm in Gecko?
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: Dynamic Logging

2016-01-08 Thread Patrick McManus
On Fri, Jan 8, 2016 at 8:32 PM, Eric Rahm  wrote:

> 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].
>


epic! thank you.
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Dynamic Logging

2016-01-08 Thread Eric Rahm
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


Re: Dynamic Logging

2016-01-08 Thread Mike Hommey
On Fri, Jan 08, 2016 at 05:32:48PM -0800, Eric Rahm 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!

I now wish we had the same for the three or so different logging systems
in use in javascript.

Mike
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: Dynamic Logging

2016-01-08 Thread Shih-Chiang Chien
Cool! Does it also work on content process?

Best Regards,
Shih-Chiang Chien
Mozilla Taiwan

On Fri, Jan 8, 2016 at 5:38 PM, Patrick McManus 
wrote:

> On Fri, Jan 8, 2016 at 8:32 PM, Eric Rahm  wrote:
>
> > 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].
> >
>
>
> epic! thank you.
> ___
> 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


Re: Dynamic Logging

2016-01-08 Thread Eric Rahm
Yes, although until bug 1234892 is fixed you'll have to restart the process
for changes to take effect.

On Fri, Jan 8, 2016 at 5:51 PM, Shih-Chiang Chien 
wrote:

> Cool! Does it also work on content process?
>
> Best Regards,
> Shih-Chiang Chien
> Mozilla Taiwan
>
> On Fri, Jan 8, 2016 at 5:38 PM, Patrick McManus 
> wrote:
>
>> On Fri, Jan 8, 2016 at 8:32 PM, Eric Rahm  wrote:
>>
>> > 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].
>> >
>>
>>
>> epic! thank you.
>> ___
>> 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


Re: Dynamic Logging

2016-01-08 Thread Bobby Holley
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


Re: Dynamic Logging

2016-01-08 Thread Philip Chee
On 09/01/2016 09:50, Mike Hommey wrote:
> On Fri, Jan 08, 2016 at 05:32:48PM -0800, Eric Rahm 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!
> 
> I now wish we had the same for the three or so different logging
> systems in use in javascript.

I think the Thunderbird version of log4moz supports using logging prefs
in this way since forever. So it's now down to two?

Phil

-- 
Philip Chee <phi...@aleytys.pc.my>, <philip.c...@gmail.com>
http://flashblock.mozdev.org/ http://xsidebar.mozdev.org
Guard us from the she-wolf and the wolf, and guard us from the thief,
oh Night, and so be good for us to pass.
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform