Re: Feature request regarding --g-fatals-warnings



On 28 Jul 2000, Martin Baulig wrote:

> Hi,
> 
> I'd like to submit a little feature request to add
> the following:
> 
> 1.) A way to specify which log levels should be considered
>     fatal on the command line (so that you can exclude
>     G_LOG_WARNING from being fatal, for instance and only
>     bail out on G_LOG_CRITICAL).

well, we currently feature --g-fatal-warnings which makes
G_LOG_LEVEL_CRITICAL and G_LOG_LEVEL_WARNING fatal.
note that that flag is really only usefull for debugging
purposes, i.e. you fire up your application in gdb and
start it with --g-fatal-warnings to get backtraces from
the points where warnings are triggered.
what you ask for is probably --g-fatal-criticals (not sure
that wording works actually), that's only make G_LOG_LEVEL_CRITICAL
fatal, but that's not really required, see my answer on 2)

> 2.) A way to ignore the first N fatal warnings on the command
>     line.
> 
>     This becomes useful when a program always displays N fatal
>     warnings on startup which you know about and which you want
>     to ignore (for instance, warnings about things being
>     deprecated).

1.2.x is a bit dump here in calling abort() on fatal log levels,
you can really only escape that with catching abort() and
skipping over that function (gdb's "return" command).
for 2.0 however, we do raise (SIGTRAP); there if debugging
is enabled (this will simply produce a core dump if not ran
in gdb), which allowes you to simply quit over any number
of fatal levels with "continue", provided you know what you are
doing.
note, that in many cases, successive warnings/criticals are
produced due to the first one failing, so often, if you don't
fix the first one, you get tons of bogus successors.

because of that, and because users really shouldn't have
the ability to simply skip over fatal situations, i.e.
where you'd call g_error() since that's often used to
catch invariant breakage and prevent further mess-ups,
i'll not introduce something like
--g-ignore-n-universe-screwups=13
and of course strongly discourage developers to do so
for gnome-libs or applications.

if you get far more than one warning, _fix_ them, and if you
use --g-fatal-warnings, you're already using gdb, and there
you can handle the situation gracefully.

> 
> -- 
> Martin Baulig
> martin@gnome.org (private)
> baulig@suse.de (work)
> 

---
ciaoTJ





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]