iaConsole.h File Reference
#include <iaux/system/iaClock.h>
#include <iaux/system/iaMutex.h>
#include <fstream>
#include <iostream>
#include <iomanip>
#include <string>
#include <thread>
#include <map>

Classes

class  iaux::iaConsole
 

Namespaces

namespace  iaux
 

Macros

#define __IGOR_LOGGING_TAB__   L" "
 
#define con_assert(Condition, Message)
 
#define con_debug(Message)
 
#define con_trace(Message)
 
#define con_trace_call()
 
#define con_crit(Message)
 
#define con_assert_sticky(Condition, Message)
 
#define con_err(Message)
 
#define con_warn(Message)
 
#define con_info(Message)
 
#define con_endl(Message)
 

Enumerations

enum class  iaux::iaForegroundColor {
  iaux::White , iaux::Gray , iaux::Blue , iaux::DarkBlue ,
  iaux::Green , iaux::DarkGreen , iaux::Cyan , iaux::DarkCyan ,
  iaux::Red , iaux::DarkRed , iaux::Magenta , iaux::DarkMagenta ,
  iaux::Yellow , iaux::DarkYellow
}
 
enum class  iaux::iaLogLevel {
  iaux::Fatal , iaux::Error , iaux::Warning , iaux::Info ,
  iaux::User , iaux::Debug , iaux::Trace
}
 

Functions

 iaux::IGOR_FUNCTION_POINTER (superspecialfuncptrtype, iaConsole &,(iaConsole &))
 
IGOR_INLINE iaConsole & iaux::endl (iaConsole &console)
 
IGOR_INLINE iaConsole & iaux::endlTab (iaConsole &console)
 
IGOR_INLINE iaConsole & iaux::flush (iaConsole &console)
 
IGOR_INLINE iaConsole & iaux::incerr (iaConsole &console)
 
IGOR_INLINE iaConsole & iaux::incwarn (iaConsole &console)
 
IGOR_INLINE iaConsole & iaux::LOCK (iaConsole &console)
 
IGOR_INLINE iaConsole & iaux::UNLOCK (iaConsole &console)
 
iaConsole & iaux::printIgorThreadID (iaConsole &console)
 
IGOR_INLINE iaConsole & iaux::applicationTime (iaConsole &console)
 
std::wostream & iaux::operator<< (std::wostream &stream, const iaLogLevel &logLevel)
 

Variables

class IAUX_API iaux::iaConsole
 

Macro Definition Documentation

◆ __IGOR_LOGGING_TAB__

#define __IGOR_LOGGING_TAB__   L" "

logging tab definition including size of time and thread ID

◆ con_assert

#define con_assert (   Condition,
  Message 
)

◆ con_assert_sticky

#define con_assert_sticky (   Condition,
  Message 
)
Value:
if (iaConsole::getInstance().getLogLevel() >= iaLogLevel::Fatal && !(Condition)) \
{ \
iaConsole::getInstance() << LOCK; \
iaConsole::getInstance().printHeader(iaLogLevel::Fatal); \
iaConsole::getInstance() << iaForegroundColor::Red << Message << " (" #Condition ")" << endlTab; \
iaConsole::getInstance() << __IGOR_FILE_LINE__ << endlTab; \
iaConsole::getInstance() << IGOR_FUNCTION << endlTab; \
iaConsole::getInstance() << "-----------------------------------------------------------------------" << endlTab; \
iaConsole::getInstance().printCallStack(); \
iaConsole::getInstance().exit(); \
iaConsole::getInstance() << UNLOCK; \
}
void printHeader(iaLogLevel logLevel)
Definition: iaConsole.cpp:232
void printCallStack(uint32 maxDepth=1000)
Definition: iaConsole.cpp:217
#define __IGOR_FILE_LINE__
Definition: iaDefines.h:67
IGOR_INLINE iaConsole & LOCK(iaConsole &console)
Definition: iaConsole.h:557
IGOR_INLINE iaConsole & endlTab(iaConsole &console)
Definition: iaConsole.h:502
IGOR_INLINE iaConsole & UNLOCK(iaConsole &console)
Definition: iaConsole.h:568

same as assert but it is not removed in release builds

Parameters
Conditiona condition that returns false in case of an error
Messageadditional message output

◆ con_crit

#define con_crit (   Message)
Value:
if (iaConsole::getInstance().getLogLevel() >= iaLogLevel::Fatal) \
{ \
iaConsole::getInstance() << LOCK; \
iaConsole::getInstance().printHeader(iaLogLevel::Fatal); \
iaConsole::getInstance() << iaForegroundColor::Red << Message << endlTab; \
iaConsole::getInstance() << __IGOR_FILE_LINE__ << endlTab; \
iaConsole::getInstance() << IGOR_FUNCTION << endlTab; \
iaConsole::getInstance() << "-----------------------------------------------------------------------" << endlTab; \
iaConsole::getInstance().printCallStack(10); \
iaConsole::getInstance().exit(); \
iaConsole::getInstance() << UNLOCK; \
}

◆ con_debug

#define con_debug (   Message)

◆ con_endl

#define con_endl (   Message)
Value:
if (iaConsole::getInstance().getLogLevel() >= iaLogLevel::User) \
{ \
iaConsole::getInstance() << LOCK; \
iaConsole::getInstance().printHeader(iaLogLevel::User); \
iaConsole::getInstance() << iaForegroundColor::Gray << Message << endl \
<< UNLOCK; \
}
IGOR_INLINE iaConsole & endl(iaConsole &console)
Definition: iaConsole.h:486

prints an message to console and optionally to the log file. In addition it prints an end line at the end.

Parameters
Messagemessage to be printed

◆ con_err

#define con_err (   Message)
Value:
if (iaConsole::getInstance().getLogLevel() >= iaLogLevel::Error) \
{ \
iaConsole::getInstance() << LOCK; \
iaConsole::getInstance().printHeader(iaLogLevel::Error); \
iaConsole::getInstance() << incerr << iaForegroundColor::DarkRed << Message << endlTab; \
iaConsole::getInstance() << __IGOR_FILE_LINE__ << endlTab; \
iaConsole::getInstance() << IGOR_FUNCTION << endlTab; \
iaConsole::getInstance() << endl \
<< UNLOCK; \
con_assert_sticky(iaConsole::getInstance().getErrors() < 100, "too many errors"); \
}
IGOR_INLINE iaConsole & incerr(iaConsole &console)
Definition: iaConsole.h:535

prints an error message to console and optionally to the log file

Parameters
Messagemessage to be printed

◆ con_info

#define con_info (   Message)
Value:
if (iaConsole::getInstance().getLogLevel() >= iaLogLevel::Info) \
{ \
iaConsole::getInstance() << LOCK; \
iaConsole::getInstance().printHeader(iaLogLevel::Info); \
iaConsole::getInstance() << iaForegroundColor::DarkBlue << Message << endl \
<< UNLOCK; \
}

prints an info message to console and optionally to the log file

Parameters
Messagemessage to be printed

◆ con_trace

#define con_trace (   Message)

◆ con_trace_call

#define con_trace_call ( )

◆ con_warn

#define con_warn (   Message)
Value:
if (iaConsole::getInstance().getLogLevel() >= iaLogLevel::Warning) \
{ \
iaConsole::getInstance() << LOCK; \
iaConsole::getInstance().printHeader(iaLogLevel::Warning); \
iaConsole::getInstance() << incwarn << iaForegroundColor::DarkYellow << Message << endlTab; \
iaConsole::getInstance() << __IGOR_FILE_LINE__ << endlTab; \
iaConsole::getInstance() << IGOR_FUNCTION << endl; \
iaConsole::getInstance() << UNLOCK; \
con_assert_sticky(iaConsole::getInstance().getWarnings() < 200, "too many warnings"); \
}
IGOR_INLINE iaConsole & incwarn(iaConsole &console)
Definition: iaConsole.h:546

prints an warning message to console and optionally to the log file

Parameters
Messagemessage to be printed