Re: GLIB: redirection of traces g_debug, g_print...



> Hi,
>
> I am working on an open source project which uses glib (g_print,
> g_debug...).
> It launches several processes thanks to DBus.
> As a consequence, I don't see the traces in th console where I have
> launched my test-file.
> I have been told that there was a way to redirect traces from g_debug,
> g_print... into a file (by setting an environment variable).
> Could you tell me how to do it?
> Thanks for your help
>

I never heard about that, but you can setup a handler to catch all the 
g_print/g_printerr and do what you want with them. This is done with 
g_set_print_handler and g_set_printerr_handler (see 'message output and 
debugging functions' in the manual). There's also a higher level handler to 
catch g_log() messages only (see g_log_set_handler in 'message logging')

-- 
Cédric Lucantis



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