#include <ErrorUtil.hpp>
|
static void | SetErrorStream (std::ostream &o) |
|
static void | SetPrintBacktrace (bool b) |
|
static bool | HasCustomErrorStream () |
|
static void | Error (ErrType type, const char *routine, int lineNumber, const char *msg, unsigned int level, bool DoComm=false) |
|
static void | Error (ErrType type, const char *routine, int lineNumber, const std::string &msg, unsigned int level) |
|
static void | Error (ErrType type, const char *routine, int lineNumber, const char *msg) |
|
Definition at line 56 of file ErrorUtil.hpp.
◆ ErrType
◆ Error() [1/3]
static void Nektar::ErrorUtil::Error |
( |
ErrType |
type, |
|
|
const char * |
routine, |
|
|
int |
lineNumber, |
|
|
const char * |
msg |
|
) |
| |
|
inlinestatic |
Definition at line 193 of file ErrorUtil.hpp.
195 Error(type, routine, lineNumber,
msg, 0);
static void Error(ErrType type, const char *routine, int lineNumber, const char *msg, unsigned int level, bool DoComm=false)
References Error(), and CellMLToNektar.pycml::msg.
◆ Error() [2/3]
static void Nektar::ErrorUtil::Error |
( |
ErrType |
type, |
|
|
const char * |
routine, |
|
|
int |
lineNumber, |
|
|
const char * |
msg, |
|
|
unsigned int |
level, |
|
|
bool |
DoComm = false |
|
) |
| |
|
inlinestatic |
Definition at line 88 of file ErrorUtil.hpp.
95 boost::ignore_unused(DoComm);
102 std::string baseMsg =
"Level " + std::to_string(
level) +
103 " assertion violation\n";
104 #if defined(NEKTAR_DEBUG) || defined(NEKTAR_FULLDEBUG)
105 baseMsg +=
"Where : " + std::string(routine) +
"[" +
106 std::to_string(lineNumber) +
"]\nMessage : ";
108 boost::ignore_unused(routine, lineNumber);
110 baseMsg += std::string(
msg);
115 #if defined(NEKTAR_USE_MPI) && !defined(NEKTAR_USE_CWIPI)
119 MPI_Initialized(&flag);
122 MPI_Comm_rank(MPI_COMM_WORLD,&rank);
126 boost::ignore_unused(DoComm);
129 std::string btMessage(
"");
130 #if defined(NEKTAR_FULLDEBUG)
138 btSize = backtrace(btArray, 40);
139 btStrings = backtrace_symbols(btArray, btSize);
141 for (
int i = 0 ; i < btSize ; ++i)
143 btMessage += std::string(btStrings[i]) +
"\n";
157 (*m_outStream) << btMessage;
159 (*m_outStream) <<
"Fatal : " << baseMsg << std::endl;
162 #if defined(NEKTAR_USE_MPI) && !defined(NEKTAR_USE_CWIPI)
167 MPI_Barrier(MPI_COMM_WORLD);
178 (*m_outStream) << btMessage;
180 (*m_outStream) <<
"Warning : " << baseMsg << std::endl;
184 (*m_outStream) <<
"Unknown warning type: " << baseMsg << std::endl;
Nektar::ErrorUtil::NekError NekError
static bool m_printBacktrace
References efatal, ewarning, CellMLToNektar.pycml::level, m_printBacktrace, and CellMLToNektar.pycml::msg.
Referenced by Error().
◆ Error() [3/3]
static void Nektar::ErrorUtil::Error |
( |
ErrType |
type, |
|
|
const char * |
routine, |
|
|
int |
lineNumber, |
|
|
const std::string & |
msg, |
|
|
unsigned int |
level |
|
) |
| |
|
inlinestatic |
◆ HasCustomErrorStream()
static bool Nektar::ErrorUtil::HasCustomErrorStream |
( |
| ) |
|
|
inlinestatic |
◆ SetErrorStream()
static void Nektar::ErrorUtil::SetErrorStream |
( |
std::ostream & |
o | ) |
|
|
inlinestatic |
◆ SetPrintBacktrace()
static void Nektar::ErrorUtil::SetPrintBacktrace |
( |
bool |
b | ) |
|
|
inlinestatic |
◆ m_outStream
std::ostream * Nektar::ErrorUtil::m_outStream = &std::cerr |
|
staticprivate |
◆ m_printBacktrace
bool Nektar::ErrorUtil::m_printBacktrace = true |
|
staticprivate |