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

RE: disable console output



> how can I suppress the WARNING outputs from libglade?
> 
> I tried 'g_log_set_handler', but that affected only my g_warning()
> calls.
> 
> The nasty output from libglade (e. g.
> (main.exe:3108): libglade-WARNING **: could not find signal handler
> 'on_save1_activate'.)
> remains.

You need to set the log handler in GTK to call a callback you specify.  That
way you can print it or ignore it.

You can do it like this:

	g_log_set_handler("libglade", 
	  	    G_LOG_LEVEL_INFO | G_LOG_LEVEL_MESSAGE |
G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL | G_LOG_FLAG_FATAL, 
		    my_log_handler_cb, 
		    NULL);


	void my_log_handler_cb(const gchar *log_domain, GLogLevelFlags
log_level, const gchar *message, gpointer user_data)
	{
		return;
	}

Regards,
Martyn



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