gsklog

gsklog — convenient logging methods around the glib mechanism

Synopsis

void                gsk_log_init                        (void);
GskLogTrap *        gsk_log_trap_domain_to_file         (const char *domain,
                                                         GLogLevelFlags level_mask,
                                                         const char *filename,
                                                         const char *output_format);
#define             gsk_debug                           (domain, ...)
#define             gsk_warning                         (domain, ...)
#define             gsk_error                           (domain, ...)
#define             gsk_critical                        (domain, ...)

Description

This file provide macros to allow logging to go to selected domains from a single compilation unit.

Also, it contains methods to conveniently trap the logs to given files.

Details

gsk_log_init ()

void                gsk_log_init                        (void);


gsk_log_trap_domain_to_file ()

GskLogTrap *        gsk_log_trap_domain_to_file         (const char *domain,
                                                         GLogLevelFlags level_mask,
                                                         const char *filename,
                                                         const char *output_format);

domain: the log-domain to trap, as passed to g_log or the gsk_ family of log functions. filename: the filename to write the log to. output_format: a string giving the formatting to be used with the given trap. It may contain any of the following strings: %{message} the message itself. %{NNNmessage} the first NNN characters of message. %{localtime:FMT} the time/date in local timezone, formatted as per FMT. %{gmtime:FMT} the time/date in gm, formatted as per FMT. (If :FMT is omitted, a default format string is used) %{domain} the log domain. %{level} the log level, as 'error', 'message', etc. %{glevel} approximately how glib does the level: 'Debug', 'Info', '*Message*', '***Warning***', '***Critical***', '***ERROR***'. %{Level}, %{LEVEL} like %{level} with casing differences. %{levelsuffix} '.', '!', '!!!' depending on the severity. %% a percent symbol.

domain :

level_mask :

filename :

output_format :

Returns :


gsk_debug()

#define             gsk_debug(domain, ...)

domain :

... :


gsk_warning()

#define             gsk_warning(domain, ...)

Log a message at the WARNING priority level. Messages logged at this level can be fatal in debugging mode.

domain :

the log-domain to use to categorize the message.

... :


gsk_error()

#define             gsk_error(domain, ...)

Log a message at the WARNING priority level. Messages logged at this level are always fatal.

domain :

the log-domain to use to categorize the message.

... :

printf-style format and arguments.

gsk_critical()

#define             gsk_critical(domain, ...)

Log a message at the CRITICAL priority level. Messages logged at this level can be fatal in debugging mode.

domain :

the log-domain to use to categorize the message.

... :

printf-style format and arguments.