CAEN Utility  2.0.2
Utilities for CAEN projects
Logger

Log related macros. More...

Macros

#define INIT_C_LOGGER(fname, mname)   static const c_locallogger_t __locallogger = { (fname), (mname) }
 
#define vlogMsg(s, format, args)   c_lvprintf(&(__locallogger), (s), (format), (args))
 
#define logMsg(s, ...)   c_lprintf(&(__locallogger), (s), __LINE__, __VA_ARGS__)
 

Detailed Description

Log related macros.

Macro Definition Documentation

◆ INIT_C_LOGGER

#define INIT_C_LOGGER (   fname,
  mname 
)    static const c_locallogger_t __locallogger = { (fname), (mname) }

Define a static instance of c_locallogger_t, setting the filename and the module tree.

Parameters
[in]fnamethe filename
[in]mnamethe module tree

Definition at line 139 of file CAENLogger.h.

◆ vlogMsg

#define vlogMsg (   s,
  format,
  args 
)    c_lvprintf(&(__locallogger), (s), (format), (args))

Wrapper to c_lvprintf(), with a reference to the local logger initialized by INIT_C_LOGGER() added as first parameter.

Parameters
[in]sthe severity mask
[in]formatstring that contains a format string that follows the same specifications as format in printf
[in]argsa variable arguments list initialized with va_start

Definition at line 148 of file CAENLogger.h.

◆ logMsg

#define logMsg (   s,
  ... 
)    c_lprintf(&(__locallogger), (s), __LINE__, __VA_ARGS__)

Wrapper to c_lprintf(), with a reference to the local logger initialized by INIT_C_LOGGER() added as first parameter.

Warning
format must be included in the "__VA_ARGS__" to avoid warnings in "gcc -std=c99 -pedantic" complaining about at least one variadic argument
Parameters
[in]sthe filename
[in]...the format, followed by an optional sequence of additional arguments.

Definition at line 157 of file CAENLogger.h.