Version: 9.12.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)   {if(YACS::traceLevel >=level)std::cerr<<__FILE__<<" ["<<__LINE__<<"] : "<<msg<<std::endl;}
 YACSTRACE macro for dynamic trace: print only if YACS_TRACELEVEL environment variable is set and level is less than its value. More...
 
#define YASSERT(val)   {if(!(val)){std::stringstream 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 AttachDebugger ()
 

Macro Definition Documentation

◆ DEBTRACE

#define DEBTRACE (   msg)

Definition at line 32 of file YacsTrace.hxx.

◆ YACSTRACE

#define YACSTRACE (   level,
  msg 
)    {if(YACS::traceLevel >=level)std::cerr<<__FILE__<<" ["<<__LINE__<<"] : "<<msg<<std::endl;}

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

Definition at line 40 of file YacsTrace.hxx.

◆ YASSERT

#define YASSERT (   val)    {if(!(val)){std::stringstream 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 44 of file YacsTrace.hxx.

Function Documentation

◆ AttachDebugger()

void AttachDebugger ( )

Definition at line 36 of file YacsTrace.cxx.

37 {
38  if(getenv ("YACSDEBUGGER"))
39  {
40  std::stringstream exec;
41  exec << "$YACSDEBUGGER " << getpid() << "&";
42  std::cerr << exec.str() << std::endl;
43  system(exec.str().c_str());
44  while(1);
45  }
46 }

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