Version: 9.15.0
YacsTrace.hxx File Reference
#include "YACSBasesExport.hxx"
#include "Exception.hxx"
#include <iostream>
#include <sstream>
Include dependency graph for YacsTrace.hxx:

Go to the source code of this file.

Namespaces

 YACS
 

Macros

#define DEBTRACE(msg)
 
#define YACSTRACE(level, msg)
 YACSTRACE macro for dynamic trace: print only if YACS_TRACELEVEL environment variable is set and level is less than its value. More...
 
#define ERROR_YACSTRACE(msg)   YACSTRACE(0,msg)
 
#define WARNING_YACSTRACE(msg)   YACSTRACE(1,msg)
 
#define INFO_YACSTRACE(msg)   YACSTRACE(2,msg)
 
#define DEBUG_YACSTRACE(msg)   YACSTRACE(7,msg)
 
#define GURU_YACSTRACE(msg)   YACSTRACE(99,msg)
 
#define YASSERT(val)   { if( !(val) ) { std::ostringstream mess; mess << __FILE__ << " [" <<__LINE__<< "] : assertion " << #val << " failed"; throw YACS::Exception(mess.str()); } }
 YASSERT macro is always defined, used like assert, but throw a YACS::Exception instead of abort. More...
 

Functions

void YACS::AppendTimeClock (std::ostream &os)
 
void AttachDebugger ()
 

Macro Definition Documentation

◆ DEBTRACE

#define DEBTRACE (   msg)

Definition at line 31 of file YacsTrace.hxx.

◆ DEBUG_YACSTRACE

#define DEBUG_YACSTRACE (   msg)    YACSTRACE(7,msg)

Definition at line 53 of file YacsTrace.hxx.

◆ ERROR_YACSTRACE

#define ERROR_YACSTRACE (   msg)    YACSTRACE(0,msg)

Definition at line 47 of file YacsTrace.hxx.

◆ GURU_YACSTRACE

#define GURU_YACSTRACE (   msg)    YACSTRACE(99,msg)

Definition at line 55 of file YacsTrace.hxx.

◆ INFO_YACSTRACE

#define INFO_YACSTRACE (   msg)    YACSTRACE(2,msg)

Definition at line 51 of file YacsTrace.hxx.

◆ WARNING_YACSTRACE

#define WARNING_YACSTRACE (   msg)    YACSTRACE(1,msg)

Definition at line 49 of file YacsTrace.hxx.

◆ YACSTRACE

#define YACSTRACE (   level,
  msg 
)
Value:
{ if(YACS::traceLevel >=level) \
{ \
AppendTimeClock(std::cerr); \
std::cerr << __FILE__ << " [" << __LINE__ << "] : " << msg << std::endl; \
} }
int traceLevel
Definition: YacsTrace.cxx:37

YACSTRACE macro for dynamic trace: print only if YACS_TRACELEVEL environment variable is set and level is less than its value.

Definition at line 41 of file YacsTrace.hxx.

◆ YASSERT

#define YASSERT (   val)    { if( !(val) ) { std::ostringstream mess; mess << __FILE__ << " [" <<__LINE__<< "] : assertion " << #val << " failed"; throw YACS::Exception(mess.str()); } }

YASSERT macro is always defined, used like assert, but throw a YACS::Exception instead of abort.

Definition at line 59 of file YacsTrace.hxx.

Function Documentation

◆ AttachDebugger()

void AttachDebugger ( )

Definition at line 52 of file YacsTrace.cxx.

53 {
54  if(getenv ("YACSDEBUGGER"))
55  {
56  std::stringstream exec;
57  exec << "$YACSDEBUGGER " << getpid() << "&";
58  std::cerr << exec.str() << std::endl;
59  system(exec.str().c_str());
60  while(1);
61  }
62 }

Referenced by YACS::ENGINE::RefCounter::~RefCounter().