Jpp test-rotations-new
the software that should make you happy
Loading...
Searching...
No Matches
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

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

Macros

#define DEBUG(A)
 Message macros.
 
#define STATUS(A)
 
#define NOTICE(A)
 
#define WARNING(A)
 
#define ERROR(A)
 
#define FATAL(A)
 
#define VARGS_STREAM(A, B, ...)
 Make std::ostream compatible output for variadic macro.
 
#define ASSERT(A, ...)
 Assert macro.
 
#define QAQC(A)
 QA/QC output macro.
 

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
 
int qaqc
 QA/QC file descriptor.
 

Detailed Description

General purpose messaging.

Author
mdejong

Definition in file JMessage.hh.

Macro Definition Documentation

◆ DEBUG

#define DEBUG ( A)
Value:
do { if (debug >= JEEP::debug_t) { std::cout << A << std::flush; } } while (0)
int debug
debug level
Definition JSirene.cc:72
@ debug_t
debug
Definition JMessage.hh:29

Message macros.

Parameters
Astd::ostream compatible output

Definition at line 62 of file JMessage.hh.

◆ STATUS

#define STATUS ( A)
Value:
do { if (debug >= JEEP::status_t) { std::cout << A << std::flush; } } while (0)
@ status_t
status
Definition JMessage.hh:30

Definition at line 63 of file JMessage.hh.

◆ NOTICE

#define NOTICE ( A)
Value:
do { if (debug >= JEEP::notice_t) { std::cerr << A << std::flush; } } while (0)
@ notice_t
notice
Definition JMessage.hh:32

Definition at line 64 of file JMessage.hh.

◆ WARNING

#define WARNING ( A)
Value:
do { if (debug >= JEEP::warning_t) { std::cerr << "WARNING: " << A << std::flush; } } while (0)
@ warning_t
warning
Definition JMessage.hh:31

Definition at line 65 of file JMessage.hh.

◆ ERROR

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

Definition at line 66 of file JMessage.hh.

◆ FATAL

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

Definition at line 67 of file JMessage.hh.

◆ VARGS_STREAM

#define VARGS_STREAM ( A,
B,
... )
Value:
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.

◆ ASSERT

#define ASSERT ( A,
... )
Value:
do { \
if (A) { NOTICE(JEEP::GREEN << "Test at " << __FILE__ << ":" << __LINE__ << " (" << #A << ") \"" << VARGS_STREAM("", ##__VA_ARGS__, "") << "\" passed." << JEEP::RESET << std::endl); } \
else { FATAL (JEEP::RED << "Test at " << __FILE__ << ":" << __LINE__ << " (" << #A << ") \"" << VARGS_STREAM("", ##__VA_ARGS__, "") << "\" failed." << JEEP::RESET << std::endl); } } while (0)
#define VARGS_STREAM(A, B,...)
Make std::ostream compatible output for variadic macro.
Definition JMessage.hh:82
#define NOTICE(A)
Definition JMessage.hh:64
#define FATAL(A)
Definition JMessage.hh:67

Assert macro.

Parameters
Atest

Definition at line 90 of file JMessage.hh.

90#define ASSERT(A, ...) do { \
91 if (A) { NOTICE(JEEP::GREEN << "Test at " << __FILE__ << ":" << __LINE__ << " (" << #A << ") \"" << VARGS_STREAM("", ##__VA_ARGS__, "") << "\" passed." << JEEP::RESET << std::endl); } \
92 else { FATAL (JEEP::RED << "Test at " << __FILE__ << ":" << __LINE__ << " (" << #A << ") \"" << VARGS_STREAM("", ##__VA_ARGS__, "") << "\" failed." << JEEP::RESET << std::endl); } } while (0)

◆ QAQC

#define QAQC ( A)
Value:
do { if (qaqc > 0) { JLANG::JFileOutputStream(qaqc) << A; } } while (0)
int qaqc
QA/QC file descriptor.
Streaming of output.

QA/QC output macro.

Parameters
Aostream compatible output

Definition at line 100 of file JMessage.hh.

Variable Documentation

◆ debug

int debug
extern

debug level

Definition at line 72 of file JSirene.cc.

◆ qaqc

int qaqc
extern

QA/QC file descriptor.