AmpGen 2.1
Loading...
Searching...
No Matches
Messaging and logging

Detailed Description

Macros

#define DEBUG(X)
 Used for printing verbose debugging messages, only if DEBUGLEVEL is defined.
 
#define INFO(X)
 Used for printing information messages, and will always be printed.
 
#define ERROR(X)
 Used for printing errors messages, and will always be printed.
 
#define FATAL(X)
 Used for printing fatal errors messages, and will always be printed and will terminate the process afterwards.
 
#define WARNING(X)
 Used for printing warning messages, can be switched off using WARNINGLEVEL.
 

Macro Definition Documentation

◆ DEBUG

#define DEBUG ( X)
Value:
{ \
if constexpr( AmpGen::detail::debug_type<typename std::decay<decltype(*this)>::type>::value ) { \
std::cout << "\033[2;32m" << std::left << std::setw( AmpGen::detail::FCNNAMELENGTH ) << AmpGen::detail::trimmedString(__PRETTY_FUNCTION__) \
<< " DEBUG " \
<< "\033[0m" << X << " " << std::endl; } }
std::string trimmedString(std::string thing, const unsigned int &length=FCNNAMELENGTH)
Definition MsgService.h:25
static constexpr int FCNNAMELENGTH
Definition MsgService.h:23

Definition at line 66 of file MsgService.h.

◆ ERROR

#define ERROR ( X)
Value:
std::cout << "\033[1;31m" << std::left << std::setw( AmpGen::detail::FCNNAMELENGTH ) << AmpGen::detail::trimmedString( __PRETTY_FUNCTION__ ) \
<< " ERROR " \
<< "\033[0m" << X << std::endl

Definition at line 80 of file MsgService.h.

◆ FATAL

#define FATAL ( X)
Value:
{ std::cout << "\033[1;31m" << std::left << std::setw( AmpGen::detail::FCNNAMELENGTH ) << AmpGen::detail::trimmedString( __PRETTY_FUNCTION__ ) \
<< " FATAL " \
<< "\033[0m" << X << std::endl; \
throw std::runtime_error( AmpGen::detail::trimmedString( __PRETTY_FUNCTION__)+ " FATAL" ) ;}

Definition at line 87 of file MsgService.h.

◆ INFO

#define INFO ( X)
Value:
AmpGen::detail::labelled_stream(__PRETTY_FUNCTION__) << X << std::endl
std::ostream & labelled_stream(const std::string &function_name)
Definition MsgService.h:46

Definition at line 75 of file MsgService.h.

◆ WARNING

#define WARNING ( X)
Value:
std::cout << "\033[1;35m" << std::left << std::setw( AmpGen::detail::FCNNAMELENGTH ) << AmpGen::detail::trimmedString( __PRETTY_FUNCTION__ ) \
<< " WARNING " \
<< "\033[0m" << X << std::endl

These messages are often harmless, but sometimes not!

Definition at line 97 of file MsgService.h.