OpenM++ runtime library (libopenm)
openm::ILog Struct Referenceabstract

log public interface: log to console and into log files More...

#include <omLog.h>

Inheritance diagram for openm::ILog:
Collaboration diagram for openm::ILog:

Public Member Functions

virtual void logErr (const std::exception &i_ex, const char *i_msg=NULL) noexcept=0
 log exception More...
 
virtual void logSql (const char *i_sql) noexcept=0
 log sql query More...
 
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. More...
 
virtual const std::string lastLogPath (void) noexcept=0
 if log to file enabled return "last" log file path. More...
 
virtual const std::string stampedLogPath (void) noexcept=0
 if log to "stamped" file enabled return "stamped" log file path. More...
 
virtual const std::string getMessage (const char *i_sourceMsg) noexcept=0
 get language-specific message by source non-translated message More...
 
virtual const std::list< std::string > getLanguages (void) noexcept=0
 get list of language name for the messages, eg: (en-ca, en) More...
 
virtual const std::unordered_map< std::string, std::string > getLanguageMessages (void) noexcept=0
 get copy of language-specific messages More...
 
virtual void swapLanguageMessages (const std::list< std::string > &i_langLst, std::unordered_map< std::string, std::string > &io_msgMap) noexcept=0
 set language-specific messages and update list of languages
 
- Public Member Functions inherited from openm::ILogBase
virtual const bool isEnabled (void) noexcept=0
 return true if log to console or to file enabled More...
 
virtual void logMsg (const char *i_msg, const char *i_extra=NULL) noexcept=0
 log message More...
 
virtual void logFormatted (const char *i_format,...) noexcept=0
 log message formatted with vsnprintf() More...
 
virtual const std::string timeStamp (void) noexcept=0
 return timestamp part of log file name: 2012_08_17_16_04_59_148. More...
 
virtual void setRank (int i_rank, int i_worldSize) noexcept=0
 use process rank as log message prefix More...
 

Detailed Description

log public interface: log to console and into log files

Member Function Documentation

◆ getLanguageMessages()

virtual const std::unordered_map< std::string, std::string > openm::ILog::getLanguageMessages ( void  )
pure virtualnoexcept

get copy of language-specific messages

Implemented in openm::Log.

◆ getLanguages()

virtual const std::list< std::string > openm::ILog::getLanguages ( void  )
pure virtualnoexcept

get list of language name for the messages, eg: (en-ca, en)

Implemented in openm::Log.

◆ getMessage()

virtual const std::string openm::ILog::getMessage ( const char *  i_sourceMsg)
pure virtualnoexcept

get language-specific message by source non-translated message

Implemented in openm::Log.

◆ init()

virtual void openm::ILog::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 
)
pure virtualnoexcept

re-initialize log file name(s) and other log settings.

Parameters
[in]i_logToConsoleif true then log to console
[in]i_basePathpath to "last" log file, if NULL or empty "" then no log file
[in]i_logToFileif true then enable log to "last" file
[in]i_useTimeStampif true then use timestamp suffix in "stamped" file name
[in]i_usePidStampif true then use PID suffix in "stamped" file name
[in]i_noMsgTimeif true then not prefix log messages with date-time
[in]i_isLogSqlif true then log SQL into log file

Implemented in openm::Log.

◆ lastLogPath()

virtual const std::string openm::ILog::lastLogPath ( void  )
pure virtualnoexcept

if log to file enabled return "last" log file path.

Implemented in openm::Log.

◆ logErr()

virtual void openm::ILog::logErr ( const std::exception &  i_ex,
const char *  i_msg = NULL 
)
pure virtualnoexcept

log exception

Implemented in openm::Log.

◆ logSql()

virtual void openm::ILog::logSql ( const char *  i_sql)
pure virtualnoexcept

log sql query

Implemented in openm::Log.

◆ stampedLogPath()

virtual const std::string openm::ILog::stampedLogPath ( void  )
pure virtualnoexcept

if log to "stamped" file enabled return "stamped" log file path.

Implemented in openm::Log.


The documentation for this struct was generated from the following files: