13#include <unordered_map>
26 virtual void logMsg(
const char * i_msg,
const char * i_extra = NULL)
noexcept = 0;
29 virtual void logFormatted(
const char * i_format, ...) noexcept = 0;
35 virtual const std::
string timeStamp(
void) noexcept = 0;
38 virtual
void setRank(
int i_rank,
int i_worldSize) noexcept = 0;
44 virtual ~ILog(
void)
noexcept = 0;
47 virtual void logErr(
const std::exception & i_ex,
const char * i_msg = NULL)
noexcept = 0;
50 virtual void logSql(
const char * i_sql)
noexcept = 0;
63 const char * i_basePath,
65 bool i_useTimeStamp =
false,
66 bool i_usePidStamp =
false,
67 bool i_noMsgTime =
false,
68 bool i_isLogSql =
false
72 virtual const std::
string lastLogPath(
void) noexcept = 0;
75 virtual const std::
string stampedLogPath(
void) noexcept = 0;
78 virtual const std::
string getMessage(const
char * i_sourceMsg) noexcept = 0;
81 virtual const std::list<std::
string> getLanguages(
void) noexcept = 0;
84 virtual const std::unordered_map<std::
string, std::
string> getLanguageMessages(
void) noexcept = 0;
87 virtual
void swapLanguageMessages(const std::list<std::
string> & i_langLst, std::unordered_map<std::
string, std::
string> & io_msgMap) noexcept = 0;
93 virtual ~ITrace(
void)
noexcept = 0;
106 const char * i_basePath,
108 bool i_useTimeStamp =
false,
109 bool i_usePidStamp =
false,
110 bool i_noMsgTime =
false
133#define LT(sourceMessage) ((theLog->getMessage(sourceMessage)).c_str())
136#define NO_LT(sourceMessage) sourceMessage
openM++ namespace
Definition: log.h:32
openm::ITrace * theTrace
trace log global instance: model debug output to console and log files
Definition: log.cpp:34
openm::ILog * theLog
log global instance: log to console and into log files
Definition: log.cpp:28
base for log public interface
Definition: omLog.h:19
virtual void logMsg(const char *i_msg, const char *i_extra=NULL) noexcept=0
log message
virtual const bool isEnabled(void) noexcept=0
return true if log to console or to file enabled
virtual const std::string timeStamp(void) noexcept=0
return timestamp part of log file name: 2012_08_17_16_04_59_148.
virtual void setRank(int i_rank, int i_worldSize) noexcept=0
use process rank as log message prefix
virtual void logFormatted(const char *i_format,...) noexcept=0
log message formatted with vsnprintf()
log public interface: log to console and into log files
Definition: omLog.h:43
virtual void init(bool i_logToConsole, const char *i_basePath, bool i_logToFile, bool i_useTimeStamp=false, bool i_usePidStamp=false, bool i_noMsgTime=false, bool i_isLogSql=false) noexcept=0
re-initialize log file name(s) and other log settings.
virtual void logErr(const std::exception &i_ex, const char *i_msg=NULL) noexcept=0
log exception
virtual void logSql(const char *i_sql) noexcept=0
log sql query
trace log public interface: model event log to console and into log files
Definition: omLog.h:92
virtual void init(bool i_logToConsole, const char *i_basePath, bool i_logToFile, bool i_useTimeStamp=false, bool i_usePidStamp=false, bool i_noMsgTime=false) noexcept=0
re-initialize log file name(s) and other log settings.