libcontrac
A library for contact tracing
Files | Macros | Functions
Logging

Allows output to be sent to the log. More...

Files

file  log.h
 Allows output to be sent to the log.
 

Macros

#define LOG(level, ...)   log_priority(level, __VA_ARGS__);
 

Functions

void log_priority (int priority, const char *format,...)
 

Detailed Description

Allows output to be sent to the log.

This is a simple set of functions and macros that allows strings to be recorded in the syslog.

Macro Definition Documentation

◆ LOG

#define LOG (   level,
  ... 
)    log_priority(level, __VA_ARGS__);

Log a string to syslog.

Constructs a message using the supplied format and parameters and records it in the system log. The format is the same as for printf.

The logging levels are the standard syslog levels:

LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERR, etc.

Parameters
priorityThe log level priority.
formatThe format for the message, the same as for printf.
...parameters to combine with the format to create the message.

Function Documentation

◆ log_priority()

void log_priority ( int  priority,
const char *  format,
  ... 
)

Log a string to syslog.

In generl, the LOG macro should be used instead.

Constructs a message using the supplied format and parameters and records it in the system log. The format is the same as for printf.

The logging levels are the standard syslog levels:

LOG_DEBUG, LOG_INFO, LOG_WARNING, LOG_ERR, etc.

Parameters
priorityThe log level priority.
formatThe format for the message, the same as for printf.
...parameters to combine with the format to create the message.