42 #ifdef __PARALLEL_MODE 48 # define __func__ __FUNCTION__ 62 LOG_LEVEL_FATAL=0, LOG_LEVEL_ERROR=0,
63 LOG_LEVEL_WARNING = 1,
64 LOG_LEVEL_RELEVANT = 2,
66 LOG_LEVEL_ALL = 4, LOG_LEVEL_DEBUG = 4
77 #ifdef __PARALLEL_MODE 85 void appendLogTo(
const std :: string &fname);
87 void appendErrorTo(
const std :: string &fname);
89 void appendLogTo(FILE* stream);
91 void appendErrorTo(FILE* stream);
92 #ifdef __PARALLEL_MODE 93 void setComm(MPI_Comm comm);
98 void writeLogMsg(
logLevelType level,
const char *format, ...);
100 void writeELogMsg(
logLevelType level,
const char *_func,
const char *_file,
int _line,
const char *format, ...);
102 void flush() { fflush(logStream); fflush(errStream); }
107 void setLogLevel(
int level);
109 void printStatistics();
121 #define OOFEM_LOG_FATAL(...) oofem_logger.writeELogMsg(Logger :: LOG_LEVEL_FATAL, __func__, __FILE__, __LINE__, __VA_ARGS__) 122 #define OOFEM_LOG_ERROR(...) oofem_logger.writeELogMsg(Logger :: LOG_LEVEL_ERROR, __func__, __FILE__, __LINE__, __VA_ARGS__) 123 #define OOFEM_LOG_WARNING(...) oofem_logger.writeELogMsg(Logger :: LOG_LEVEL_WARNING, __func__, __FILE__, __LINE__, __VA_ARGS__) 125 #define OOFEM_LOG_FORCED(...) oofem_logger.writeLogMsg(Logger :: LOG_LEVEL_FORCED, __VA_ARGS__) 126 #define OOFEM_LOG_RELEVANT(...) oofem_logger.writeLogMsg(Logger :: LOG_LEVEL_RELEVANT, __VA_ARGS__) 127 #define OOFEM_LOG_INFO(...) oofem_logger.writeLogMsg(Logger :: LOG_LEVEL_INFO, __VA_ARGS__) 128 #define OOFEM_LOG_DEBUG(...) oofem_logger.writeLogMsg(Logger :: LOG_LEVEL_DEBUG, __VA_ARGS__)
void setLogLevel(logLevelType level)
Sets log level to given one. Only log messages with level less or equal given threshold will be print...
FILE * logStream
Stream used for logging.
void flush()
Flushes the log stream.
Logger oofem_logger(Logger::LOG_LEVEL_INFO)
Logger class used by OOFEM to print information during analysis.
logLevelType logLevel
Current log level, messages with higher level are not reported.
logLevelType
Type defining basic log levels.
int numberOfWrn
Counter of all warning and error messages.
the oofem namespace is to define a context or scope in which all oofem names are defined.