>As part of the effort to improve logging in gecko we'd like to introduce a new 
>set of unified log levels.

>*PR_LOG_DEBUG + 1 aka log level 5*
>
>Various bits of code invented a log level that was less important than
>debug (I would call this verbose). This was not specified in NSPR logging,
>but just kind of worked. With the addition of |Info| we can transition code
>that was using this pseudo log level to:
>  - map PR_LOG_DEBUG     => Info
>  - map PR_LOG_DEBUG + 1 => Debug
>
>In this case we could have added a |Verbose| log level, but with the
>addition of |Info| and feeling that fewer is better we have decided against
>that.

This is used extensively in WebRTC and related media bits to enable
*huge* amounts of debugs (like every-frame debugs for audio or video or
per-network-packet debugs, which will swamp a system normally), and since
people are used to enabling "debug" on random modules (or all:5), having
verbose debugs in the "normal" :5 setting will cause pain.

The above will also be surprising since it will work "differently" than
other modules, making the same sorts of debugs appear at different
levels.  This would be expecially confusing to people not frequently
working in the module or when external users are asked to turn on
debugging.

At minimum, I'd like to keep some form of Verbose (or VerboseDebug, or
what have you) to avoid this "surprise" factor.

The alternative would be to add more log types -- split signaling:6 into
signaling:debug,signaling_verbose:debug for example.  Somewhat annoying
but works.  I'd prefer a 'Verbose' setting.

Then there's an oddball: webrtc.org "Trace" logging (a separate
subsystem with low-overhead buffered-IO circular-log maxed at 10MB),
which requires a 16-bit mask.  Currently this is exposed as
webrtc_trace:65535 (for example), with a separate env var telling it
where to put the logfile (or 'nspr' to revector the logs through NSPR
logging, which *really* will cause problems with realtime code but is
handy at times).  For this oddball, we could do other things like move
it to a separate env var (which is annoying to people using it, but not
horribly).

>*How will log levels be controlled?*
>
>Similar to how it works now (if not terribly clear), turning on:
>  - LogLevel::Error   => Error messages will be printed
>  - LogLevel::Warning => Error and Warning messages will be printed
>  - LogLevel::Info    => Error, Warning, and Info messages will be printed
>  - LogLevel::Debug   => Error, Warning, Info, and Debug messages will be 
> printed

what's the interface to NSPR_LOG_MODULES?  still with the numerics, or
do we have to use
NSPR_LOG_MODULES=signaling:debug,mediamanager:debug,getusermedia:debug,mtransport:debug,mediastreamgraph:debug
etc?  (That gets a bit old... not that numerics are "better", but
they're faster to type/read and lots of existing scripts/etc have them.)
Obviously one could have numbers and names.

>As a future improvement we plan to add the ability to toggle this levels at 
>runtime.

This would be wonderful!  Been looking for that for years (and years).

-- 
Randell Jesup, Mozilla Corp
remove "news" for personal email
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to