girara
 
Loading...
Searching...
No Matches
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(...)
 
#define girara_info(...)
 
#define girara_warning(...)
 
#define girara_error(...)
 

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 ( ...)
Value:
girara_log(G_STRLOC, __func__, GIRARA_DEBUG, __VA_ARGS__)
void girara_log(const char *location, const char *function, girara_log_level_t level, const char *format,...) GIRARA_PRINTF(4
@ GIRARA_DEBUG
Definition log.h:15

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

Definition at line 25 of file log.h.

◆ girara_error

#define girara_error ( ...)
Value:
girara_log(G_STRLOC, __func__, GIRARA_ERROR, __VA_ARGS__)
@ GIRARA_ERROR
Definition log.h:18

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

Definition at line 40 of file log.h.

◆ girara_info

#define girara_info ( ...)
Value:
girara_log(G_STRLOC, __func__, GIRARA_INFO, __VA_ARGS__)
@ GIRARA_INFO
Definition log.h:16

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

Definition at line 30 of file log.h.

◆ girara_warning

#define girara_warning ( ...)
Value:
girara_log(G_STRLOC, __func__, GIRARA_WARNING, __VA_ARGS__)
@ GIRARA_WARNING
Definition log.h:17

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

Definition at line 35 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 51 of file log.h.