Jpp  15.0.3
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Namespaces | Macros | Enumerations | Variables
JMessage.hh File Reference

General purpose messaging. More...

#include <iostream>
#include "JLang/JFileStream.hh"
#include "Jeep/JColor.hh"

Go to the source code of this file.

Classes

struct  JEEP::JMessage< T >
 Auxiliary class for handling debug parameter within a class. More...
 

Namespaces

 JEEP
 General puprpose classes and methods.
 
 JPP
 This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
 

Macros

#define DEBUG(A)   do { if (debug >= JEEP::debug_t) { std::cout << A << std::flush; } } while (0)
 Message macros. More...
 
#define STATUS(A)   do { if (debug >= JEEP::status_t) { std::cout << A << std::flush; } } while (0)
 
#define NOTICE(A)   do { if (debug >= JEEP::notice_t) { std::cerr << A << std::flush; } } while (0)
 
#define WARNING(A)   do { if (debug >= JEEP::warning_t) { std::cerr << "WARNING: " << A << std::flush; } } while (0)
 
#define ERROR(A)   do { { std::cerr << "ERROR: " << A << std::flush; } } while (0)
 
#define FATAL(A)   do { { std::cerr << "FATAL: " << A << std::endl; exit(1); } } while (0)
 
#define VARGS_STREAM(A, B,...)   B
 Make std::ostream compatible output for variadic macro. More...
 
#define ASSERT(A,...)
 Assert macro. More...
 
#define QAQC(A)   do { if (qaqc > 0) { JLANG::JFileOutputStream(qaqc) << A; } } while (0)
 QA/QC output macro. More...
 

Enumerations

enum  JEEP::JMessage_t {
  JEEP::debug_t = 3, JEEP::status_t = 2, JEEP::warning_t = 2, JEEP::notice_t = 1,
  JEEP::error_t = 0, JEEP::fatal_t = 0
}
 Debug level. More...
 

Variables

int debug
 debug level More...
 
int qaqc
 QA/QC file descriptor. More...
 

Detailed Description

General purpose messaging.

Author
mdejong

Definition in file JMessage.hh.

Macro Definition Documentation

#define DEBUG (   A)    do { if (debug >= JEEP::debug_t) { std::cout << A << std::flush; } } while (0)

Message macros.

Parameters
Astd::ostream compatible output

Definition at line 62 of file JMessage.hh.

#define STATUS (   A)    do { if (debug >= JEEP::status_t) { std::cout << A << std::flush; } } while (0)

Definition at line 63 of file JMessage.hh.

#define NOTICE (   A)    do { if (debug >= JEEP::notice_t) { std::cerr << A << std::flush; } } while (0)

Definition at line 64 of file JMessage.hh.

#define WARNING (   A)    do { if (debug >= JEEP::warning_t) { std::cerr << "WARNING: " << A << std::flush; } } while (0)

Definition at line 65 of file JMessage.hh.

#define ERROR (   A)    do { { std::cerr << "ERROR: " << A << std::flush; } } while (0)

Definition at line 66 of file JMessage.hh.

#define FATAL (   A)    do { { std::cerr << "FATAL: " << A << std::endl; exit(1); } } while (0)

Definition at line 67 of file JMessage.hh.

#define VARGS_STREAM (   A,
  B,
  ... 
)    B

Make std::ostream compatible output for variadic macro.

When called,

  • first argument should correspond to a dummy value;
  • second to the ##__VA_ARGS__ macro; and
  • third to the fall back value (e.g. "");
Parameters
Adummy value
B##__VA_ARGS__ macro
Returns
output

Definition at line 82 of file JMessage.hh.

#define ASSERT (   A,
  ... 
)
Value:
do { \
if (A) { NOTICE(JEEP::GREEN << "Test at " << __FILE__ << ":" << __LINE__ << " (" << #A << ") \"" << VARGS_STRING("", ##__VA_ARGS__, "") << "\" passed." << JEEP::RESET << std::endl); } \
else { FATAL (JEEP::RED << "Test at " << __FILE__ << ":" << __LINE__ << " (" << #A << ") \"" << VARGS_STRING("", ##__VA_ARGS__, "") << "\" failed." << JEEP::RESET << std::endl); } } while (0)
#define NOTICE(A)
Definition: JMessage.hh:64
#define FATAL(A)
Definition: JMessage.hh:67
#define VARGS_STRING(A, B,...)
Make string for variadic macro.
Definition: JPrint.hh:133
source $JPP_DIR setenv csh $JPP_DIR &dev null eval JShellParser o a A
do if[[!-f $ACOUSTICS_WORKDIR/${KEY}.txt]]
Definition: JAcoustics.sh:39

Assert macro.

Parameters
Atest

Definition at line 90 of file JMessage.hh.

#define QAQC (   A)    do { if (qaqc > 0) { JLANG::JFileOutputStream(qaqc) << A; } } while (0)

QA/QC output macro.

Parameters
Aostream compatible output

Definition at line 100 of file JMessage.hh.

Variable Documentation

int debug

debug level

Definition at line 63 of file JSirene.cc.

int qaqc

QA/QC file descriptor.