pnmixer
Volume mixer for the system tray
Macros | Enumerations | Functions | Variables
support-log.h File Reference

Logging support. More...

#include <glib.h>
Include dependency graph for support-log.h:

Go to the source code of this file.

Macros

#define ERROR(...)   log_msg(LOG_ERROR, __FILE__, __VA_ARGS__)
 
#define WARN(...)   log_msg(LOG_WARN, __FILE__, __VA_ARGS__)
 
#define DEBUG(...)   log_msg(LOG_DEBUG, __FILE__, __VA_ARGS__)
 

Enumerations

enum  log_level { LOG_ERROR, LOG_WARN, LOG_DEBUG }
 

Functions

void log_msg_v (enum log_level level, const char *file, const char *format, va_list args)
 
void log_msg (enum log_level level, const char *file, const char *format,...)
 

Variables

gboolean want_debug
 

Detailed Description

Logging support.

Logging support. Provides various macros to print debug, warning & error messages. Debug messages are enabled with a command-line argument. This should be included by every file.

Definition in file support-log.h.

Macro Definition Documentation

◆ DEBUG

#define DEBUG (   ...)    log_msg(LOG_DEBUG, __FILE__, __VA_ARGS__)

Definition at line 38 of file support-log.h.

◆ ERROR

#define ERROR (   ...)    log_msg(LOG_ERROR, __FILE__, __VA_ARGS__)

Definition at line 36 of file support-log.h.

◆ WARN

#define WARN (   ...)    log_msg(LOG_WARN, __FILE__, __VA_ARGS__)

Definition at line 37 of file support-log.h.

Enumeration Type Documentation

◆ log_level

enum log_level
Enumerator
LOG_ERROR 
LOG_WARN 
LOG_DEBUG 

Definition at line 27 of file support-log.h.

Function Documentation

◆ log_msg()

void log_msg ( enum log_level  level,
const char *  file,
const char *  format,
  ... 
)

Log a message.

Parameters
levelthe log level.
filethe file name.
formatthe message format. See the printf() documentation.
...the parameters to insert into the format string.

Definition at line 84 of file support-log.c.

◆ log_msg_v()

void log_msg_v ( enum log_level  level,
const char *  file,
const char *  format,
va_list  args 
)

Log a message.

Parameters
levelthe log level.
filethe file name.
formatthe message format. See the printf() documentation.
argsthe parameters to insert into the format string.

Definition at line 49 of file support-log.c.

Variable Documentation

◆ want_debug

gboolean want_debug

Global variable to control whether we want debugging. This variable is initialized in main() and depends on the '–debug'/'-d' command line argument.

Definition at line 38 of file support-log.c.