OpenM++ runtime library (libopenm)
omLog.h File Reference

OpenM++: public interface for log and trace support. More...

Include dependency graph for omLog.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  openm::ILogBase
 base for log public interface More...
 
struct  openm::ILog
 log public interface: log to console and into log files More...
 
struct  openm::ITrace
 trace log public interface: model event log to console and into log files More...
 

Namespaces

namespace  openm
 openM++ namespace
 

Macros

#define CHECKPOINT(x)   { openm::the_checkpoint_location = std::source_location::current(); openm::the_checkpoint_message = x; }
 save checkpoint message and source code location
 
#define LOG_CHECKPOINT
 output to the log latest checkpoint message and source code location More...
 
#define LT(sourceMessage)   ((theLog->getMessage(sourceMessage)).c_str())
 LT localisation function: return is temporary const char* and must be copied to avoid memory violation crash.
 
#define NO_LT(sourceMessage)   sourceMessage
 NO_LT localisation function: return source content as is. More...
 

Variables

thread_local const char * openm::the_checkpoint_message = ""
 checkpoint log message
 
thread_local std::source_location openm::the_checkpoint_location
 checkpoint source code location: file name, line and column
 
openm::ILogtheLog
 log global instance: log to console and into log files More...
 
openm::ITracetheTrace
 trace log global instance: model debug output to console and log files More...
 

Detailed Description

OpenM++: public interface for log and trace support.

Macro Definition Documentation

◆ LOG_CHECKPOINT

#define LOG_CHECKPOINT
Value:
theLog->logFormatted("%s: [%d,%d] %s", \
thread_local std::source_location the_checkpoint_location
checkpoint source code location: file name, line and column
Definition: omLog.h:119
thread_local const char * the_checkpoint_message
checkpoint log message
Definition: omLog.h:116
openm::ILog * theLog
log global instance: log to console and into log files
Definition: log.cpp:28
virtual void logFormatted(const char *i_format,...) noexcept=0
log message formatted with vsnprintf()

output to the log latest checkpoint message and source code location

◆ NO_LT

#define NO_LT (   sourceMessage)    sourceMessage

NO_LT localisation function: return source content as is.

Use it to suppress translation, for example: WarningMsg( NO_LT("};") );

Variable Documentation

◆ theLog

openm::ILog* theLog
extern

log global instance: log to console and into log files

log global instance: log to console and into log files

◆ theTrace

openm::ITrace* theTrace
extern

trace log global instance: model debug output to console and log files

trace log global instance: model debug output to console and log files