LibraryLink Utilities  3.0.1
Modern C++ wrapper over LibraryLink and WSTP
Logger.h File Reference

Define Logger namespace containing logging related declarations and convenience macros. More...

Detailed Description

Define Logger namespace containing logging related declarations and convenience macros.

Author
Rafal Chojna rafal.nosp@m.c@wo.nosp@m.lfram.nosp@m..com
#include <initializer_list>
#include <mutex>
#include <string>
#include <utility>
#include "LLU/LibraryData.h"
#include "LLU/WSTP/WSStream.hpp"
+ Include dependency graph for Logger.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  LLU::Logger
 Logger class is responsible for sending log messages via WSTP to Mathematica. More...
 

Namespaces

 LLU
 Main namespace of LibraryLink Utilities.
 

Macros

#define LLU_LOG_LEVEL_DEBUG
 
#define LLU_LOG_WARNING
 
#define LLU_LOG_DEBUG
 
#define LLU_LOG_LEVEL_WARNING
 
#define LLU_LOG_ERROR
 
#define LLU_LOG_LEVEL_ERROR
 
#define LLU_DEBUG(...)   LLU::Logger::log<LLU::Logger::Level::Debug>(__LINE__, __FILE__, __func__, __VA_ARGS__)
 Log a message (arbitrary sequence of arguments that can be passed via WSTP) as debug information, the log will consist of the line number, file name, function name and user-provided args. More...
 
#define LLU_WARNING(...)   LLU::Logger::log<LLU::Logger::Level::Warning>(__LINE__, __FILE__, __func__, __VA_ARGS__)
 Log a message (arbitrary sequence of arguments that can be passed via WSTP) as warning, the log will consist of the line number, file name, function name and user-provided args. More...
 
#define LLU_ERROR(...)   LLU::Logger::log<LLU::Logger::Level::Error>(__LINE__, __FILE__, __func__, __VA_ARGS__)
 Log a message (arbitrary sequence of arguments that can be passed via WSTP) as error, the log will consist of the line number, file name, function name and user-provided args. More...
 

Macro Definition Documentation

◆ LLU_DEBUG

#define LLU_DEBUG (   ...)    LLU::Logger::log<LLU::Logger::Level::Debug>(__LINE__, __FILE__, __func__, __VA_ARGS__)

Log a message (arbitrary sequence of arguments that can be passed via WSTP) as debug information, the log will consist of the line number, file name, function name and user-provided args.

Formatting can be customized on the Wolfram Language side.

Note
This macro is only active with LLU_LOG_DEBUG compilation flag.

◆ LLU_ERROR

#define LLU_ERROR (   ...)    LLU::Logger::log<LLU::Logger::Level::Error>(__LINE__, __FILE__, __func__, __VA_ARGS__)

Log a message (arbitrary sequence of arguments that can be passed via WSTP) as error, the log will consist of the line number, file name, function name and user-provided args.

Formatting can be customized on the Wolfram Language side.

Note
This macro is only active with LLU_LOG_DEBUG, LLU_LOG_WARNING or LLU_LOG_ERROR compilation flag.

◆ LLU_LOG_DEBUG

#define LLU_LOG_DEBUG

Define LLU_LOG_DEBUG to enable all log levels

◆ LLU_LOG_ERROR

#define LLU_LOG_ERROR

Define LLU_LOG_ERROR to enable only error logs. Debug and warning logs will be ignored.

◆ LLU_LOG_WARNING

#define LLU_LOG_WARNING

Define LLU_LOG_WARNING to enable warning and error logs. Debug logs will be ignored.

◆ LLU_WARNING

#define LLU_WARNING (   ...)    LLU::Logger::log<LLU::Logger::Level::Warning>(__LINE__, __FILE__, __func__, __VA_ARGS__)

Log a message (arbitrary sequence of arguments that can be passed via WSTP) as warning, the log will consist of the line number, file name, function name and user-provided args.

Formatting can be customized on the Wolfram Language side.

Note
This macro is only active with LLU_LOG_DEBUG or LLU_LOG_WARNING compilation flag.