Peano
Loading...
Searching...
No Matches
Log.h File Reference
#include <mpi.h>
#include <iostream>
#include <sstream>
#include <functional>
#include <ctime>
#include <chrono>
#include "config.h"
Include dependency graph for Log.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

class  tarch::logging::Log
 Log Device. More...
 

Namespaces

namespace  tarch
 Have to include this header, as I need access to the SYCL_EXTERNAL keyword.
 
namespace  tarch::logging
 

Macros

#define logDebug(methodName, logMacroMessageStream)
 
#define logTraceIn(methodName)
 
#define logTraceInWith1Argument(methodName, argument0)
 
#define logTraceInWith2Arguments(methodName, argument0, argument1)
 
#define logTraceInWith3Arguments(methodName, argument0, argument1, argument2)
 
#define logTraceInWith4Arguments(methodName, argument0, argument1, argument2, argument3)
 
#define logTraceInWith5Arguments(methodName, argument0, argument1, argument2, argument3, argument4)
 
#define logTraceInWith6Arguments(methodName, argument0, argument1, argument2, argument3, argument4, argument5)
 
#define logTraceInWith7Arguments(methodName, argument0, argument1, argument2, argument3, argument4, argument5, argument6)
 
#define logTraceInWith8Arguments(methodName, argument0, argument1, argument2, argument3, argument4, argument5, argument6, argument7)
 
#define logTraceInWith9Arguments(methodName, argument0, argument1, argument2, argument3, argument4, argument5, argument6, argument7, argument8)
 
#define logTraceOut(methodName)
 
#define logTraceOutWith1Argument(methodName, argument0)
 
#define logTraceOutWith2Arguments(methodName, argument0, argument1)
 
#define logTraceOutWith3Arguments(methodName, argument0, argument1, argument2)
 
#define logTraceOutWith4Arguments(methodName, argument0, argument1, argument2, argument3)
 
#define logTraceOutWith5Arguments(methodName, argument0, argument1, argument2, argument3, argument4)
 
#define logTraceOutWith6Arguments(methodName, argument0, argument1, argument2, argument3, argument4, argument5)
 
#define logTraceOutWith7Arguments(methodName, argument0, argument1, argument2, argument3, argument4, argument5, argument6)
 
#define logTraceOutWith8Arguments(methodName, argument0, argument1, argument2, argument3, argument4, argument5, argument6, argument7)
 
#define logTraceOutWith12Arguments(methodName, argument0, argument1, argument2, argument3, argument4, argument5, argument6, argument7, argument8, argument9, argument10, argument11)
 
#define logInfo(methodName, logMacroMessageStream)
 Wrapper macro around tarch::tarch::logging::Log to improve logging.
 
#define logExceptionAndQuit(exception)
 
#define logWarning(methodName, logMacroMessageStream)
 Wrapper macro around tarch::tarch::logging::Log to improve logging.
 
#define logError(methodName, logMacroMessageStream)
 Wrapper macro around tarch::tarch::logging::Log to improve logging.
 

Macro Definition Documentation

◆ logDebug

◆ logError

#define logError ( methodName,
logMacroMessageStream )
Value:
{ \
auto logMacroMessage = [&](void) -> std::string { \
std::ostringstream conv; \
conv << logMacroMessageStream; \
conv << " (file:" << __FILE__ << ",line:" << __LINE__ << ")"; \
return conv.str(); \
}; \
_log.error (methodName, logMacroMessage); \
}
void error(const std::string &methodName, Message logMacroMessage)
Log an Error.

Wrapper macro around tarch::tarch::logging::Log to improve logging.

A Log object with name _log has to be defined at the place of calling this macro.

This macro allows to combine strings and variables arbitrarily in an efficient way (only one ostringstream object has to be created per usage of logError).

Usage: logInfo( "myOperation()", "anyText" << myVar << ",anotherText" << myVar2 );

Definition at line 464 of file Log.h.

Referenced by peano4::stacks::STDVectorStack< T >::startReceive(), and peano4::stacks::STDVectorStack< T >::startSend().

◆ logExceptionAndQuit

#define logExceptionAndQuit ( exception)
Value:
{ \
std::cerr << std::string("caught exception (file:)") << __FILE__ << std::string(", line:") << __LINE__ << std::string("): ") << std::string(exception.what()); \
exit(-1); \
}

Definition at line 421 of file Log.h.

◆ logInfo

#define logInfo ( methodName,
logMacroMessageStream )
Value:
{ \
auto logMacroMessage = [&](void) -> std::string { \
std::ostringstream conv; \
conv << logMacroMessageStream; \
return conv.str(); \
}; \
_log.info (methodName, logMacroMessage); \
}
void info(const std::string &methodName, Message logMacroMessage)
Log Information.

Wrapper macro around tarch::tarch::logging::Log to improve logging.

A Log object with name _log has to be defined at the place of calling this macro.

This macro allows to combine strings and variables arbitrarily in an efficient way (only one ostringstream object has to be created per usage of logInfo).

Usage: logInfo( "myOperation()", "anyText" << myVar << ",anotherText" << myVar2 );

!!! Hint

Never use the + operator to concatenate data as this is error-prone. If you use always the << operator, you are on the safe side, as the + operator works only for strings properly. If you use it with a string and another data type, it might be that the string is assigned an invalid length.

Definition at line 411 of file Log.h.

Referenced by toolbox::loadbalancing::strategies::cascade::Cascade< HostedLoadBalancing0, HostedLoadBalancing1 >::enable(), and toolbox::loadbalancing::strategies::cascade::Cascade< HostedLoadBalancing0, HostedLoadBalancing1 >::finishStep().

◆ logTraceIn

#define logTraceIn ( methodName)

Definition at line 369 of file Log.h.

◆ logTraceInWith1Argument

#define logTraceInWith1Argument ( methodName,
argument0 )

Definition at line 370 of file Log.h.

◆ logTraceInWith2Arguments

#define logTraceInWith2Arguments ( methodName,
argument0,
argument1 )

Definition at line 371 of file Log.h.

◆ logTraceInWith3Arguments

#define logTraceInWith3Arguments ( methodName,
argument0,
argument1,
argument2 )

Definition at line 372 of file Log.h.

◆ logTraceInWith4Arguments

#define logTraceInWith4Arguments ( methodName,
argument0,
argument1,
argument2,
argument3 )

◆ logTraceInWith5Arguments

#define logTraceInWith5Arguments ( methodName,
argument0,
argument1,
argument2,
argument3,
argument4 )

Definition at line 374 of file Log.h.

◆ logTraceInWith6Arguments

#define logTraceInWith6Arguments ( methodName,
argument0,
argument1,
argument2,
argument3,
argument4,
argument5 )

Definition at line 375 of file Log.h.

◆ logTraceInWith7Arguments

#define logTraceInWith7Arguments ( methodName,
argument0,
argument1,
argument2,
argument3,
argument4,
argument5,
argument6 )

Definition at line 376 of file Log.h.

◆ logTraceInWith8Arguments

#define logTraceInWith8Arguments ( methodName,
argument0,
argument1,
argument2,
argument3,
argument4,
argument5,
argument6,
argument7 )

Definition at line 377 of file Log.h.

◆ logTraceInWith9Arguments

#define logTraceInWith9Arguments ( methodName,
argument0,
argument1,
argument2,
argument3,
argument4,
argument5,
argument6,
argument7,
argument8 )

Definition at line 378 of file Log.h.

◆ logTraceOut

#define logTraceOut ( methodName)

Definition at line 379 of file Log.h.

◆ logTraceOutWith12Arguments

#define logTraceOutWith12Arguments ( methodName,
argument0,
argument1,
argument2,
argument3,
argument4,
argument5,
argument6,
argument7,
argument8,
argument9,
argument10,
argument11 )

Definition at line 388 of file Log.h.

◆ logTraceOutWith1Argument

#define logTraceOutWith1Argument ( methodName,
argument0 )

◆ logTraceOutWith2Arguments

#define logTraceOutWith2Arguments ( methodName,
argument0,
argument1 )

Definition at line 381 of file Log.h.

◆ logTraceOutWith3Arguments

#define logTraceOutWith3Arguments ( methodName,
argument0,
argument1,
argument2 )

Definition at line 382 of file Log.h.

◆ logTraceOutWith4Arguments

#define logTraceOutWith4Arguments ( methodName,
argument0,
argument1,
argument2,
argument3 )

Definition at line 383 of file Log.h.

◆ logTraceOutWith5Arguments

#define logTraceOutWith5Arguments ( methodName,
argument0,
argument1,
argument2,
argument3,
argument4 )

Definition at line 384 of file Log.h.

◆ logTraceOutWith6Arguments

#define logTraceOutWith6Arguments ( methodName,
argument0,
argument1,
argument2,
argument3,
argument4,
argument5 )

Definition at line 385 of file Log.h.

◆ logTraceOutWith7Arguments

#define logTraceOutWith7Arguments ( methodName,
argument0,
argument1,
argument2,
argument3,
argument4,
argument5,
argument6 )

Definition at line 386 of file Log.h.

◆ logTraceOutWith8Arguments

#define logTraceOutWith8Arguments ( methodName,
argument0,
argument1,
argument2,
argument3,
argument4,
argument5,
argument6,
argument7 )

Definition at line 387 of file Log.h.

◆ logWarning

#define logWarning ( methodName,
logMacroMessageStream )
Value:
{ \
auto logMacroMessage = [&](void) -> std::string { \
std::ostringstream conv; \
conv << logMacroMessageStream; \
conv << " (file:" << __FILE__ << ",line:" << __LINE__ << ")"; \
return conv.str(); \
}; \
_log.warning(methodName, logMacroMessage); \
}
void warning(const std::string &methodName, Message logMacroMessage)
Log a Warning.

Wrapper macro around tarch::tarch::logging::Log to improve logging.

A Log object with name _log has to be defined at the place of calling this macro.

This macro allows to combine strings and variables arbitrarily in an efficient way (only one ostringstream object has to be created per usage of logWarning).

Usage: logWarning( "myOperation()", "anyText" << myVar << ",anotherText" << myVar2 );

Definition at line 440 of file Log.h.