Using GLib logging functions in applications



What is the recommended way to use GLib's message logging facilities in
an application? My app needs to keep a log file with configurable log
levels.

The API is almost perfect for my needs, but doesn't support writing
to an alternate file descriptor. Instead, it uses stdout and stderr
according to severity of the message. I wouldn't like to write my own
logging handler because I want the thread safety and formatting features
of the default one. I don't want to redirect the standard io either,
because that's a little too global in effect.

Am I out of luck? Do I need to copy most of the code from gmessages.[ch]
? The default handler uses a number of private functions so I would need
to copy them too.

-- 
Gaal Yahas <gaal forum2 org>
http://gaal.livejournal.com/



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