GSK Reference Manual | ||||
---|---|---|---|---|
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, ...)
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.
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 : |
#define gsk_debug(domain, ...)
Log a message at the DEBUG priority level.
domain : |
the log-domain to use to categorize the message. |
... : |
printf-style format and arguments. |
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
#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. |
... : |
printf-style format and arguments. |
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
#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. |
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
#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. |
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |
|
... : |