| Guifications Library Reference Manual |
|---|
GfLogGfLog — GfLog Object API |
#define GF_LOG_DEFAULT enum GfLogLevel; GfLog; GfLog* gf_log_new (void); void gf_log_open (GfLog *log); void gf_log_vargs (GfLog *log, GfLogLevel level, const gchar *category, const gchar *format, va_list args); void gf_log (GfLog *log, GfLogLevel level, const gchar *category, const gchar *format, ...); void gf_log_critical (GfLog *log, const gchar *category, const gchar *format, ...); void gf_log_warning (GfLog *log, const gchar *category, const gchar *format, ...); void gf_log_event (GfLog *log, const gchar *category, const gchar *format, ...); void gf_log_info (GfLog *log, const gchar *category, const gchar *format, ...); void gf_log_verbose (GfLog *log, const gchar *category, const gchar *format, ...); void gf_log_close (GfLog *log); void gf_log_set_level (GfLog *log, GfLogLevel level); GfLogLevel gf_log_get_level (GfLog *log); void gf_log_set_timestamp_format (GfLog *log, const gchar *format); const gchar* gf_log_get_timestamp_format (const GfLog *log); void gf_log_set_timestamp_visible (GfLog *log, gboolean value); gboolean gf_log_get_timestamp_visible (const GfLog *log); #define gf_log_level_from_string (str) #define gf_log_level_to_string (level, i18n) void gf_logs_set_default_log (GfLog *log); GfLog* gf_logs_get_default_log (void);
"level" GfLogLevel : Read / Write "ts-format" gchararray : Read / Write "ts-visible" gboolean : Read / Write
GfLog is the base class of all loggers. It is also a console logger that will log output directly to the console.
#define GF_LOG_DEFAULT NULL
An identifier to tell the log writing API to use the default log.
typedef enum _GfLogLevel {
GF_LOG_LEVEL_UNKNOWN = -1,
GF_LOG_LEVEL_VERBOSE = 0,
GF_LOG_LEVEL_INFO,
GF_LOG_LEVEL_EVENT,
GF_LOG_LEVEL_WARNING,
GF_LOG_LEVEL_CRITICAL,
GF_LOG_LEVELS
} GfLogLevel;
The different levels of logging.
GF_LOG_LEVEL_UNKNOWN |
Unknown. |
GF_LOG_LEVEL_VERBOSE |
Logs everything. |
GF_LOG_LEVEL_INFO |
Logs critical, warning, event and info entries. |
GF_LOG_LEVEL_EVENT |
Logs critical, warning, and event entries. |
GF_LOG_LEVEL_WARNING |
Logs critical and warning entries. |
GF_LOG_LEVEL_CRITICAL |
Only logs critical entries. |
GF_LOG_LEVELS |
Total levels. |
GfLog* gf_log_new (void);
Creates a new console logger.
| Returns : | A new instance of GfLog. |
void gf_log_vargs (GfLog *log, GfLogLevel level, const gchar *category, const gchar *format, va_list args);
Writes to log.
log : |
The GfLog instance. |
level : |
The GfLogLevel for the entry. |
category : |
The category for the entry. |
format : |
The format for the entry. |
args : |
The arguments for format.
|
void gf_log (GfLog *log, GfLogLevel level, const gchar *category, const gchar *format, ...);
Writes to log.
log : |
The GfLog instance. |
level : |
The GfLogLevel for the entry. |
category : |
The category for the entry. |
format : |
The format for the entry. |
... : |
The arguments for format.
|
void gf_log_critical (GfLog *log, const gchar *category, const gchar *format, ...);
Writes a critical entry to log.
log : |
The GfLog instance. |
category : |
The category for the entry. |
format : |
The format for the entry. |
... : |
The arguments for format.
|
void gf_log_warning (GfLog *log, const gchar *category, const gchar *format, ...);
Writes a warning entry to log.
log : |
The GfLog instance. |
category : |
The category for the entry. |
format : |
The format for the entry. |
... : |
The arguments for format.
|
void gf_log_event (GfLog *log, const gchar *category, const gchar *format, ...);
Writes an event entry to log.
log : |
The GfLog instance. |
category : |
The category for the entry. |
format : |
The format for the entry. |
... : |
The arguments for format.
|
void gf_log_info (GfLog *log, const gchar *category, const gchar *format, ...);
Writes an information entry to log.
log : |
The GfLog instance. |
category : |
The category for the entry. |
format : |
The format for the entry. |
... : |
The arguments for format.
|
void gf_log_verbose (GfLog *log, const gchar *category, const gchar *format, ...);
Writes a verbose entry to log.
log : |
The GfLog instance. |
category : |
The category for the entry. |
format : |
The format for the entry. |
... : |
The arguments for format.
|
void gf_log_set_level (GfLog *log, GfLogLevel level);
Sets the GfLogLevel of log to be level. Which means only entries up to
and including level will be output to log.
log : |
The GfLog instance. |
level : |
The new GfLogLevel. |
GfLogLevel gf_log_get_level (GfLog *log);
Gets the GfLogLevel from log.
log : |
The GfLog instance. |
| Returns : | The current GfLogLevel of log.
|
void gf_log_set_timestamp_format (GfLog *log, const gchar *format);
Sets the timestamp format of log to format.
log : |
The GfLog instance. |
format : |
The new timestamp format in strftime format. |
const gchar* gf_log_get_timestamp_format (const GfLog *log);
Gets the timestamp format of log.
log : |
The GfLog instance. |
| Returns : | The timestamp format of log.
|
void gf_log_set_timestamp_visible (GfLog *log, gboolean value);
Sets whether or not to show timestamps in log.
Note: It is up to the individual log implementations to enforce this.
log : |
The GfLog instance. |
value : |
TRUE to show timestamps, FALSE to hide them. |
gboolean gf_log_get_timestamp_visible (const GfLog *log);
Gets whether or not timestamps are being shown for log.
log : |
The GfLog instance. |
| Returns : | TRUE if timestamps are visible, FALSE otherwise. |
#define gf_log_level_from_string(str)
Gets a GfLogLevel from a string.
Note str MUST be the untranslated string!
str : |
The string. |
| Returns : | The GfLogLevel. |
#define gf_log_level_to_string(level, i18n)
Gets a string from a GfLogLevel
level : |
The GfLogLevel. |
i18n : |
TRUE for the translated string. |
| Returns : |
style as a string.
|
void gf_logs_set_default_log (GfLog *log);
Sets the default log for the GfLog subsystem.
log : |
A valid GfLog instance. |
level" property"level" GfLogLevel : Read / Write
The level of log entries to display.
Default value: Verbose
ts-format" property"ts-format" gchararray : Read / Write
The format string for timestamps.
Default value: "%X"
| << Logging | GfLogFile >> |