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(...)
 Convenience wrapper message macros.
#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 ( ...   ) 

Convenience wrapper message macros.

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] thread Pointer to a GThread structure of the thread.
[in] name String 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] thread Pointer 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] filename Filename for logfile, or NULL to use stderr.
[in] mode Open mode for fopen().
[in] level Default 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 
)

Generated on 8 Jun 2011 for Audacious by  doxygen 1.6.1