Audacious  $Id:Doxyfile42802007-03-2104:39:00Znenolod$
Defines | Enumerations | Functions
log.h File Reference

Informative logging API (aud_log(), aud_debug() and friends). More...

#include <glib.h>
#include <stdarg.h>

Go to the source code of this file.

Defines

#define AUD_LOG_CTX   NULL
#define aud_message(...)   aud_log(AUD_LOG_CTX, AUD_LOG_INFO, __VA_ARGS__)
 Convenience wrapper message macros.
#define aud_warning(...)   aud_log(AUD_LOG_CTX, AUD_LOG_WARNING, __VA_ARGS__)
 Convenience wrapper message macros.
#define AUDDBG(...)
 Debug message macro and transitional aliases.
#define aud_debug(...)
 Debug message macro and transitional aliases.
#define AUDDBG_I(...)
 Extra debug messages (more noisy, needs DEBUG > 1)

Enumerations

enum  AudLogLevel {
  AUD_LOG_NONE = 0, AUD_LOG_FATAL_ERROR, AUD_LOG_ERROR, AUD_LOG_WARNING,
  AUD_LOG_INFO, AUD_LOG_DEBUG, AUD_LOG_DEBUG_INT, AUD_LOG_ALL
}
 Log levels from least noisy to noisiest. More...

Functions

gint aud_log_init (const gchar *filename, const gchar *mode, gint level)
 Initialize logging subsystem.
void aud_log_close (void)
 Shut down the logging subsystem.
void aud_log_add_thread_context (GThread *thread, const gchar *name)
 Add symbolic name for given thread identifier.
void aud_log_delete_thread_context (GThread *thread)
 Removes identifier for thread, if present.
void aud_logv (const gchar *ctx, gint level, const gchar *fmt, va_list args) __attribute__((format(printf
void void aud_log (const gchar *ctx, gint level, const gchar *fmt,...) __attribute__((format(printf
void void void aud_log_line (const gchar *ctx, gint level, const gchar *file, const gchar *func, gint line, const gchar *fmt,...) __attribute__((format(printf

Detailed Description

Informative logging API (aud_log(), aud_debug() and friends).

Functions for logfile handling, log contexts, logging levels, etc. Also functions and macros for debug-level stuff.

Definition in file log.h.


Define Documentation

#define aud_debug (   ...)

Debug message macro and transitional aliases.

Definition at line 98 of file log.h.

#define AUD_LOG_CTX   NULL

Definition at line 28 of file log.h.

#define aud_message (   ...)    aud_log(AUD_LOG_CTX, AUD_LOG_INFO, __VA_ARGS__)

Convenience wrapper message macros.

Definition at line 83 of file log.h.

#define aud_warning (   ...)    aud_log(AUD_LOG_CTX, AUD_LOG_WARNING, __VA_ARGS__)

Convenience wrapper message macros.

Definition at line 84 of file log.h.

#define AUDDBG (   ...)
#define AUDDBG_I (   ...)

Extra debug messages (more noisy, needs DEBUG > 1)

Definition at line 110 of file log.h.


Enumeration Type Documentation

Log levels from least noisy to noisiest.

Enumerator:
AUD_LOG_NONE 

Pseudo log-level for suppressing most log messages.

AUD_LOG_FATAL_ERROR 
AUD_LOG_ERROR 
AUD_LOG_WARNING 
AUD_LOG_INFO 
AUD_LOG_DEBUG 

General debugging.

AUD_LOG_DEBUG_INT 

Intensive debugging (more details)

AUD_LOG_ALL 

Pseudo log-level for full logging.

Definition at line 40 of file log.h.


Function Documentation

void void aud_log ( const gchar *  ctx,
gint  level,
const gchar *  fmt,
  ... 
)
void aud_log_add_thread_context ( GThread *  thread,
const gchar *  name 
)

Add symbolic name for given thread identifier.

The identifier will be used in subsequent log messages originating from the thread.

Parameters:
[in]threadPointer to a GThread structure of the thread.
[in]nameString describing the thread.

Definition at line 286 of file log.c.

void aud_log_close ( void  )

Shut down the logging subsystem.

Logfile handle is closed, mutexes and such freed, etc.

Definition at line 241 of file log.c.

void aud_log_delete_thread_context ( GThread *  thread)

Removes identifier for thread, if present.

If thread had not been added in first place (via aud_log_add_thread_context()), a warning is logged instead.

Parameters:
[in]threadPointer to a GThread structure of the thread.

Definition at line 312 of file log.c.

gint aud_log_init ( const gchar *  filename,
const gchar *  mode,
gint  level 
)

Initialize logging subsystem.

Parameters:
[in]filenameFilename for logfile, or NULL to use stderr.
[in]modeOpen mode for fopen().
[in]levelDefault logging level.

Definition at line 169 of file log.c.

void void void aud_log_line ( const gchar *  ctx,
gint  level,
const gchar *  file,
const gchar *  func,
gint  line,
const gchar *  fmt,
  ... 
)
void aud_logv ( const gchar *  ctx,
gint  level,
const gchar *  fmt,
va_list  args 
)