Re: stop on Gtk-WARNING



On 10/17/05, Boncek, John <jboncek hunter com> wrote:
When a GTK app gets Gtk-WARNINGs without actually stopping, it can be hard
to determine exactly where they're coming from.  Is there a way to tell
GTK to stop immediately on such a warning?  This would allow using a
debugger to localize the first warning much more easily.

I have something like this near the start of my main():

#ifdef DEBUG
        g_log_set_always_fatal(
                G_LOG_FLAG_RECURSION |
                G_LOG_FLAG_FATAL |
                G_LOG_LEVEL_ERROR |
                G_LOG_LEVEL_CRITICAL |
                G_LOG_LEVEL_WARNING );
#endif /*DEBUG*/

Alternatively, you can pass --g-fatal-warnings as a command-line
argument to any gtk program.

Either technique will cause your program to abort() on the first
warning, so you can get a stack trace if you run in a debugger.

See

http://developer.gnome.org/doc/API/2.0/glib/glib-Message-Logging.html

J



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