Logging

Logging — Logging Routines

Functions

void storaged_log ()
#define storaged_debug()
#define storaged_info()
#define storaged_notice()
#define storaged_warning()
#define storaged_error()

Types and Values

Description

Logging routines.

Functions

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.

Parameters

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.

Parameters

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.

Parameters

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.

Parameters

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.

Parameters

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.

Parameters

args...

printf()-style format string and arguments

 

Types and Values

enum 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.

Members

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.