Logging

Logging — Logging Routines

Synopsis

enum                StoragedLogLevel;
void                storaged_log                        (StoragedLogLevel level,
                                                         const gchar *function,
                                                         const gchar *location,
                                                         const gchar *format,
                                                         ...);
#define             storaged_debug                      (...)
#define             storaged_info                       (...)
#define             storaged_notice                     (...)
#define             storaged_warning                    (...)
#define             storaged_error                      (...)

Description

Logging routines.

Details

enum StoragedLogLevel

typedef enum {
  STORAGED_LOG_LEVEL_DEBUG,
  STORAGED_LOG_LEVEL_INFO,
  STORAGED_LOG_LEVEL_NOTICE,
  STORAGED_LOG_LEVEL_WARNING,
  STORAGED_LOG_LEVEL_ERROR
} StoragedLogLevel;

Logging levels. The level STORAGED_LOG_LEVEL_NOTICE and above goes to syslog.

Unlike g_warning() and g_error(), none of these logging levels causes the program to ever terminate.

STORAGED_LOG_LEVEL_DEBUG

Debug messages.

STORAGED_LOG_LEVEL_INFO

Informational messages.

STORAGED_LOG_LEVEL_NOTICE

Messages that the administrator should take notice of.

STORAGED_LOG_LEVEL_WARNING

Warning messages.

STORAGED_LOG_LEVEL_ERROR

Error messages.

storaged_log ()

void                storaged_log                        (StoragedLogLevel level,
                                                         const gchar *function,
                                                         const gchar *location,
                                                         const gchar *format,
                                                         ...);

Low-level logging function used by storaged_debug() and other macros.

level :

A StoragedLogLevel.

function :

Pass G_STRFUNC here.

location :

Pass G_STRLOC here.

format :

printf()-style format.

... :

Arguments for format.

storaged_debug()

#define storaged_debug(args...)   storaged_log(STORAGED_LOG_LEVEL_DEBUG, G_STRFUNC, G_STRLOC, args)

Logging macro for STORAGED_LOG_LEVEL_DEBUG.

See StoragedLogLevel for more details.

args... :

printf()-style format string and arguments

storaged_info()

#define storaged_info(args...)    storaged_log(STORAGED_LOG_LEVEL_INFO, G_STRFUNC, G_STRLOC, args)

Logging macro for STORAGED_LOG_LEVEL_INFO.

See StoragedLogLevel for more details.

args... :

printf()-style format string and arguments

storaged_notice()

#define storaged_notice(args...)    storaged_log(STORAGED_LOG_LEVEL_NOTICE, G_STRFUNC, G_STRLOC, args)

Logging macro for STORAGED_LOG_LEVEL_NOTICE.

See StoragedLogLevel for more details.

args... :

printf()-style format string and arguments

storaged_warning()

#define storaged_warning(args...) storaged_log(STORAGED_LOG_LEVEL_WARNING, G_STRFUNC, G_STRLOC, args)

Logging macro for STORAGED_LOG_LEVEL_WARNING.

See StoragedLogLevel for more details.

args... :

printf()-style format string and arguments

storaged_error()

#define storaged_error(args...)   storaged_log(STORAGED_LOG_LEVEL_ERROR, G_STRFUNC, G_STRLOC, args)

Logging macro for STORAGED_LOG_LEVEL_ERROR.

See StoragedLogLevel for more details.

args... :

printf()-style format string and arguments