Re: glib message logging and AllocConsole

"hermanator12002" <[email protected]>
Newsgroups gmane.comp.video.gimp.windows.devel
Message-ID <[email protected]>
--- In gimpwin-dev@y..., Allin Cottrell <cottrell@r...> wrote:
> On Wed, 9 Oct 2002, Herman Bloggs wrote:
> 
> > I am working on a win32 Gtk app using the mingw compiler.  I have
> > noticed that when ever glib uses the default logging handler, it
> > makes a call to AllocConsole.  This ends up bringing up a console
> > window in Win9x despite having linked with the -mwindows (and no
> > -mconsole).
> 
> Yes, but unless you want to suppress all warning/error messages 
(that
> is an option)

I do want to suppress all of them, can you describe this option?

>, the only way they can appear -- or perhaps I should say
> the most straightforward way for them to appear -- is to pop up a
> "console"  window.  It's very ugly, granted, but then it's trying 
to 
> tell you that something has gone wrong.

Yes I agree this is necessary, but there should be a separation 
between those error messages intended for a developer and those 
intended for the user, and short of being able to do this I would 
like to spare the user from seeing the console, even if the app is in 
alpha.  Currently I leave it up to the user, if he would like to see 
the logging messages he can specify an option on the command line.

> 
> Just "thinking out loud" here:  Wouldn't it be better if the default
> were to pop up Windows message boxes rather than a "DOS box"?  '"GTK
> is going nuts!" <OK>'.  But a problem with this is that when things 
go
> badly wrong you can get a huge spew of repetitive error messages: so
> which would you rather have: an ugly "console" showing the list of
> errors, or the desktop littered with dozens of message boxes all
> saying the same thing, each one demanding to be dismissed with a 
mouse
> click?
> 
> I'd say, first option is to tune your code so you don't get
> errors/warnings.  Second line of defence, if you're sure the 
warnings 
> are misleading or somehow don't really matter, suppress them with a 
> dummy log handler.

That is what I am doing, but it seems I am missing some log domains 
because occasionally the console still comes up, that is why I was 
asking if there is a way to set a handler for all domains without 
individually setting handlers.

> 
> void dummy_output_handler (const gchar *log_domain,
>                            GLogLevelFlags log_level,
>                            const gchar *message,
>                            gpointer user_data)
> {
>     return;
> }
> 
> Allin Cottrell.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.