girara
Macros | Enumerations | Functions | Variables
log.h File Reference
#include <glib.h>
#include <stdarg.h>
#include "macros.h"

Go to the source code of this file.

Macros

#define girara_debug(...)   girara_log(G_STRLOC, __func__, GIRARA_DEBUG, __VA_ARGS__)
 
#define girara_info(...)   girara_log(G_STRLOC, __func__, GIRARA_INFO, __VA_ARGS__)
 
#define girara_warning(...)   girara_log(G_STRLOC, __func__, GIRARA_WARNING, __VA_ARGS__)
 
#define girara_error(...)   girara_log(G_STRLOC, __func__, GIRARA_ERROR, __VA_ARGS__)
 

Enumerations

enum  girara_log_level_t { GIRARA_DEBUG , GIRARA_INFO , GIRARA_WARNING , GIRARA_ERROR }
 

Functions

void girara_log (const char *location, const char *function, girara_log_level_t level, const char *format,...) GIRARA_PRINTF(4
 
void girara_vlog (const char *location, const char *function, girara_log_level_t level, const char *format, va_list ap) GIRARA_VISIBLE
 
girara_log_level_t girara_get_log_level (void) GIRARA_VISIBLE
 
void girara_set_log_level (girara_log_level_t level) GIRARA_VISIBLE
 

Variables

void GIRARA_VISIBLE
 

Macro Definition Documentation

◆ girara_debug

#define girara_debug (   ...)    girara_log(G_STRLOC, __func__, GIRARA_DEBUG, __VA_ARGS__)

Prints a debug message. The arguments are passed to girara_log as last argument.

Definition at line 26 of file log.h.

◆ girara_error

#define girara_error (   ...)    girara_log(G_STRLOC, __func__, GIRARA_ERROR, __VA_ARGS__)

Prints an error message. The arguments are passed to girara_log as last argument.

Definition at line 41 of file log.h.

◆ girara_info

#define girara_info (   ...)    girara_log(G_STRLOC, __func__, GIRARA_INFO, __VA_ARGS__)

Prints an info message. The arguments are passed to girara_log as last argument.

Definition at line 31 of file log.h.

◆ girara_warning

#define girara_warning (   ...)    girara_log(G_STRLOC, __func__, GIRARA_WARNING, __VA_ARGS__)

Prints a warning message. The arguments are passed to girara_log as last argument.

Definition at line 36 of file log.h.

Enumeration Type Documentation

◆ girara_log_level_t

Log levels

Enumerator
GIRARA_DEBUG 
GIRARA_INFO 

‍Debug messages

GIRARA_WARNING 

‍Information debug output

GIRARA_ERROR 

‍Warning level

‍Error

Definition at line 14 of file log.h.

Function Documentation

◆ girara_get_log_level()

girara_log_level_t girara_get_log_level ( void  )

Get the log level.

Returns
The log level.

◆ girara_log()

void girara_log ( const char *  location,
const char *  function,
girara_log_level_t  level,
const char *  format,
  ... 
)

Print a message.

Parameters
locationlocation of the call
functioncalling function
levelThe log level of the message.
formatprintf like format string

◆ girara_set_log_level()

void girara_set_log_level ( girara_log_level_t  level)

Set the log level. Any message with a level lower than the log level will be discarded.

Parameters
levelThe new log level.

◆ girara_vlog()

void girara_vlog ( const char *  location,
const char *  function,
girara_log_level_t  level,
const char *  format,
va_list  ap 
)

Print a message.

Parameters
locationlocation of the call
functioncalling function
levelThe log level of the message.
formatprintf like format string
apvarag list

Variable Documentation

◆ GIRARA_VISIBLE

void GIRARA_VISIBLE

Definition at line 52 of file log.h.