43#ifdef __MPI_PARALLEL_MODE
49# define __func__ __FUNCTION__
78#ifdef __MPI_PARALLEL_MODE
93#ifdef __MPI_PARALLEL_MODE
100 #if defined(__GNUC__) || defined (__clang)
101 __attribute__((format(printf, 3, 4)))
106 #if defined(__GNUC__) || defined (__clang)
107 __attribute__((format(printf, 6, 7)))
116 void setLogLevel(
int level);
120 void printStatistics();
128 const char *giveLevelName(logLevelType l)
const;
137#define OOFEM_LOG_FATAL(...) oofem_logger.writeELogMsg(Logger :: LOG_LEVEL_FATAL, __func__, __FILE__, __LINE__, __VA_ARGS__)
138#define OOFEM_LOG_ERROR(...) oofem_logger.writeELogMsg(Logger :: LOG_LEVEL_ERROR, __func__, __FILE__, __LINE__, __VA_ARGS__)
139#define OOFEM_LOG_WARNING(...) oofem_logger.writeELogMsg(Logger :: LOG_LEVEL_WARNING, __func__, __FILE__, __LINE__, __VA_ARGS__)
141#define OOFEM_LOG_FORCED(...) oofem_logger.writeLogMsg(Logger :: LOG_LEVEL_FORCED, __VA_ARGS__)
142#define OOFEM_LOG_RELEVANT(...) oofem_logger.writeLogMsg(Logger :: LOG_LEVEL_RELEVANT, __VA_ARGS__)
143#define OOFEM_LOG_INFO(...) oofem_logger.writeLogMsg(Logger :: LOG_LEVEL_INFO, __VA_ARGS__)
144#define OOFEM_LOG_DEBUG(...) oofem_logger.writeLogMsg(Logger :: LOG_LEVEL_DEBUG, __VA_ARGS__)
void setComm(MPI_Comm comm)
Parallell comm.
void setLogLevel(logLevelType level)
Sets log level to given one. Only log messages with level less or equal given threshold will be print...
void flush()
Flushes the log stream.
bool closeFlag
flag indicating whether to close mylogStream.
void incrementErrorCounter()
Increment error count by one.
logLevelType
Type defining basic log levels.
int numberOfWrn
Counter of all warning and error messages.
void appendLogTo(const std ::string &fname)
Redirects log output to given file name (with path).
MPI_Comm comm
Parallell comm.
void writeLogMsg(logLevelType level, const char *format,...)
Writes the normal log message.
void appendErrorTo(const std ::string &fname)
Redirects error output to given file name (with path).
void getNumberOfWarningsAndErrors(int &nwrns, int &nerrs)
Returns local (mpi-process) statistics.
logLevelType logLevel
Current log level, messages with higher level are not reported.
void writeELogMsg(logLevelType level, const char *_func, const char *_file, int _line, const char *format,...)
Writes extended log message with file and line info.
FILE * logStream
Stream used for logging.
Logger(logLevelType level)
Logger oofem_logger(Logger ::LOG_LEVEL_INFO)