Flow123d
release_3.0.0-973-g92f55e826
|
Go to the documentation of this file.
35 #include <boost/algorithm/string/predicate.hpp>
36 #include <boost/algorithm/string/trim.hpp>
37 #include <boost/format.hpp>
68 {
Warn,
true,
false,
SCR_STDERR,
false,
"\nWarning ({}, {}(), {:d}):\n"},
69 {
UsrErr,
true,
false,
SCR_NONE,
true,
"\nUser Error ({}, {}(), {:d}):\n"},
70 {
Err,
true,
false,
SCR_NONE,
true,
"\nError ({}, {}(), {:d}):\n"},
71 {
PrgErr,
true,
false,
SCR_NONE,
true,
"\nInternal Error ({}, {}(), {:d}):\n"}
85 int _xprintf(
const char *
const xprintf_file,
const char *
const xprintf_func,
const int xprintf_line,
MessageType type,
const char *
const fmt, ... )
91 static int mpi_msg_id = 0;
112 char format_message[1024];
113 va_start( argptr,
fmt );
114 vsprintf(format_message,
fmt, argptr);
119 BOOST_THROW_EXCEPTION( ExcXprintfMsg()
120 << EI_XprintfHeader(
fmt::format(mf.
head, xprintf_file, xprintf_func, xprintf_line) )
121 << EI_XprintfMessage( format_message ) );
125 ASSERT(
false).error(
"Non error usage of xprintf is not allowed.");
143 printf(
"MPI_Barrier() error in xprintf()\n");
144 exit( EXIT_FAILURE );
154 #ifndef FLOW123D_DEBUG_MESSAGES
155 if (type ==
Warn) mf.
head=
"\nWarning: ";
169 va_start( argptr,
fmt );
178 va_start( argptr,
fmt );
INTERNAL DEFINITIONS FOR XPRINTF.
#define ASSERT(expr)
Allow use shorter versions of macro names if these names is not used with external library.
FMT_FUNC int fprintf(std::ostream &os, CStringRef format, ArgList args)
bool mpi
treat as global message (invoke MPI_Barrier() when printing)
std::string format(CStringRef format_str, ArgList args)
bool stop
terminate the program
const char * head
message formating string
int screen
print to stdout,stderr,NULL
int _xprintf(const char *const xprintf_file, const char *const xprintf_func, const int xprintf_line, MessageType type, const char *const fmt,...)
Multi-purpose printing routine: messages, warnings, errors.
MessageType
Identifiers for various output messages.
void printf(BasicWriter< Char > &w, BasicCStringRef< Char > format, ArgList args)
bool log
log the message - YES/NO
static struct MsgFmt msg_fmt[]
System structure for various global variables.
#define MPI_Barrier(comm)