ROOT-Sim core  3.0.0-rc.2
A General-Purpose Multi-threaded Parallel/Distributed Simulation Library
Macros | Functions
log.h File Reference

Logging library. More...

#include <ROOT-Sim.h>
Include dependency graph for log.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define logger(level, ...)   vlogger(level, __FILE__, __LINE__, __VA_ARGS__)
 Produce a log message. More...
 

Functions

void vlogger (enum log_level level, char *file, unsigned line, const char *fmt,...)
 Logs a message. Don't use this function directly, rely on the logger() macro instead. More...
 
void log_init (FILE *file)
 Initialize the logging subsystem. More...
 

Detailed Description

Logging library.

This library can be used to produce logs during simulation runs.

Macro Definition Documentation

◆ logger

#define logger (   level,
  ... 
)    vlogger(level, __FILE__, __LINE__, __VA_ARGS__)

Produce a log message.

Parameters
levelthe logging level associated to the message
...the format string followed by its arguments if needed

Function Documentation

◆ log_init()

void log_init ( FILE *  file)

Initialize the logging subsystem.

Parameters
fileThe FILE to write logging information to. If set to NULL, it is defaulted to stdout.

◆ vlogger()

void vlogger ( enum log_level  level,
char *  file,
unsigned  line,
const char *  fmt,
  ... 
)

Logs a message. Don't use this function directly, rely on the logger() macro instead.

Parameters
levelthe importance level of the message to logger
filethe source file from which the log function was invoked
linethe line number where this function is being called
fmta printf-style format string for the message to logger
...the list of arguments to fill in the format string fmt