Essentia  2.1-beta6-dev
debugging.h File Reference
#include <deque>
#include <string>
#include <algorithm>
#include <climits>
#include "config.h"
#include "streamutil.h"
#include "stringutil.h"
#include <unistd.h>

Go to the source code of this file.

Classes

class  Logger
 

Namespaces

 essentia
 

Macros

#define E_DEBUG_INDENT   debugIndentLevel++
 
#define E_DEBUG_OUTDENT   debugIndentLevel--
 
#define E_ACTIVE(module)   ((module) & activatedDebugLevels)
 
#define E_STRINGIFY(msg)   (Stringifier() << msg).str()
 
#define E_DEBUG_NONL(module, msg)   if (E_ACTIVE(module)) loggerInstance.debug(module, E_STRINGIFY(msg), false)
 
#define E_DEBUG(module, msg)   if (E_ACTIVE(module)) loggerInstance.debug(module, E_STRINGIFY(msg << '\n'), true)
 
#define ALGONAME   _name << std::string((std::max)(15-(int)_name.size(), 0), ' ') << ": "
 
#define EXEC_DEBUG(msg)   E_DEBUG(EExecution, ALGONAME << nProcess << " - " << msg)
 
#define E_INFO(msg)   loggerInstance.info(E_STRINGIFY(msg))
 
#define E_WARNING(msg)   loggerInstance.warning(E_STRINGIFY(msg))
 
#define E_ERROR(msg)   loggerInstance.error(E_STRINGIFY(msg))
 

Typedefs

typedef int DebuggingSchedule[][3]
 
typedef std::vector< std::pair< std::pair< int, int >, int > > DebuggingScheduleVector
 

Enumerations

enum  DebuggingModule {
  EAlgorithm = 1 << 0 , EConnectors = 1 << 1 , EFactory = 1 << 2 , ENetwork = 1 << 3 ,
  EGraph = 1 << 4 , EExecution = 1 << 5 , EMemory = 1 << 6 , EScheduler = 1 << 7 ,
  EPython = 1 << 20 , EPyBindings = 1 << 21 , EUnittest = 1 << 22 , EUser1 = 1 << 25 ,
  EUser2 = 1 << 26 , ENone = 0 , EAll = (1 << 30) - 1
}
 

Functions

const char * debugModuleDescription (DebuggingModule module)
 
void setDebugLevel (int levels)
 
void unsetDebugLevel (int levels)
 
void saveDebugLevels ()
 
void restoreDebugLevels ()
 
void scheduleDebug (DebuggingSchedule schedule, int nentries)
 
void scheduleDebug (const DebuggingScheduleVector &schedule)
 
void setDebugLevelForTimeIndex (int index)
 

Variables

int activatedDebugLevels
 
bool infoLevelActive
 
bool warningLevelActive
 
bool errorLevelActive
 
int debugIndentLevel
 
Logger loggerInstance
 

Macro Definition Documentation

◆ ALGONAME

#define ALGONAME   _name << std::string((std::max)(15-(int)_name.size(), 0), ' ') << ": "

◆ E_ACTIVE

#define E_ACTIVE (   module)    ((module) & activatedDebugLevels)

◆ E_DEBUG

#define E_DEBUG (   module,
  msg 
)    if (E_ACTIVE(module)) loggerInstance.debug(module, E_STRINGIFY(msg << '\n'), true)

◆ E_DEBUG_INDENT

#define E_DEBUG_INDENT   debugIndentLevel++

◆ E_DEBUG_NONL

#define E_DEBUG_NONL (   module,
  msg 
)    if (E_ACTIVE(module)) loggerInstance.debug(module, E_STRINGIFY(msg), false)

◆ E_DEBUG_OUTDENT

#define E_DEBUG_OUTDENT   debugIndentLevel--

◆ E_ERROR

#define E_ERROR (   msg)    loggerInstance.error(E_STRINGIFY(msg))

◆ E_INFO

#define E_INFO (   msg)    loggerInstance.info(E_STRINGIFY(msg))

◆ E_STRINGIFY

#define E_STRINGIFY (   msg)    (Stringifier() << msg).str()

◆ E_WARNING

#define E_WARNING (   msg)    loggerInstance.warning(E_STRINGIFY(msg))

◆ EXEC_DEBUG

#define EXEC_DEBUG (   msg)    E_DEBUG(EExecution, ALGONAME << nProcess << " - " << msg)