OMSimulatorLib
The OMSimulator project is a FMI-based co-simulation environment that supports ordinary (i.e., non-delayed) and TLM connections.
Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
Log Class Reference

#include <Logging.h>

Collaboration diagram for Log:
Collaboration graph

Static Public Member Functions

static void Info (const std::string &msg)
 
static oms_status_enu_t Warning (const std::string &msg)
 
static oms_status_enu_t Error (const std::string &msg, const std::string &function)
 
static void Debug (const std::string &msg)
 
static void Trace (const std::string &function, const std::string &file, const long line)
 
static void ProgressBar (double start, double stop, double value)
 
static void TerminateBar ()
 
static oms_status_enu_t setLogFile (const std::string &filename)
 
static void setMaxLogFileSize (const unsigned long size)
 
static void setLoggingCallback (void(*cb)(oms_message_type_enu_t type, const char *message))
 
static oms_status_enu_t setLoggingLevel (int logLevel)
 
static const int getLoggingLevel ()
 
static bool DebugEnabled ()
 
static bool TraceEnabled ()
 

Private Member Functions

 Log ()
 
 ~Log ()
 
void printStringToStream (std::ostream &stream, const std::string &type, const std::string &msg)
 
 Log (Log const &copy)
 not implemented More...
 
Logoperator= (Log const &copy)
 not implemented More...
 

Static Private Member Functions

static LoggetInstance ()
 

Private Attributes

int logLevel
 
std::string filename
 
std::ofstream logFile
 
std::mutex m
 
unsigned int numWarnings
 
unsigned int numErrors
 
unsigned int numMessages
 
unsigned long limit = 1024*1024*50
 
unsigned long size = 0
 
bool progress = false
 
int percent
 
void(* cb )(oms_message_type_enu_t type, const char *message)
 

Constructor & Destructor Documentation

◆ Log() [1/2]

Log::Log ( )
private
Here is the caller graph for this function:

◆ ~Log()

Log::~Log ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Log() [2/2]

Log::Log ( Log const &  copy)
private

not implemented

Member Function Documentation

◆ Debug()

void Log::Debug ( const std::string &  msg)
static
Here is the call graph for this function:

◆ DebugEnabled()

bool Log::DebugEnabled ( )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Error()

oms_status_enu_t Log::Error ( const std::string &  msg,
const std::string &  function 
)
static
Here is the call graph for this function:

◆ getInstance()

Log & Log::getInstance ( )
staticprivate
Here is the caller graph for this function:

◆ getLoggingLevel()

const int Log::getLoggingLevel ( )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Info()

void Log::Info ( const std::string &  msg)
static
Here is the call graph for this function:

◆ operator=()

Log& Log::operator= ( Log const &  copy)
private

not implemented

Here is the caller graph for this function:

◆ printStringToStream()

void Log::printStringToStream ( std::ostream &  stream,
const std::string &  type,
const std::string &  msg 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ProgressBar()

void Log::ProgressBar ( double  start,
double  stop,
double  value 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setLogFile()

oms_status_enu_t Log::setLogFile ( const std::string &  filename)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setLoggingCallback()

static void Log::setLoggingCallback ( void(*)(oms_message_type_enu_t type, const char *message)  cb)
inlinestatic
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setLoggingLevel()

oms_status_enu_t Log::setLoggingLevel ( int  logLevel)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setMaxLogFileSize()

static void Log::setMaxLogFileSize ( const unsigned long  size)
inlinestatic
Here is the call graph for this function:
Here is the caller graph for this function:

◆ TerminateBar()

void Log::TerminateBar ( )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Trace()

void Log::Trace ( const std::string &  function,
const std::string &  file,
const long  line 
)
static
Here is the call graph for this function:

◆ TraceEnabled()

bool Log::TraceEnabled ( )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Warning()

oms_status_enu_t Log::Warning ( const std::string &  msg)
static
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ cb

void(* Log::cb) (oms_message_type_enu_t type, const char *message)
private

◆ filename

std::string Log::filename
private

◆ limit

unsigned long Log::limit = 1024*1024*50
private

◆ logFile

std::ofstream Log::logFile
private

◆ logLevel

int Log::logLevel
private

◆ m

std::mutex Log::m
private

◆ numErrors

unsigned int Log::numErrors
private

◆ numMessages

unsigned int Log::numMessages
private

◆ numWarnings

unsigned int Log::numWarnings
private

◆ percent

int Log::percent
private

◆ progress

bool Log::progress = false
private

◆ size

unsigned long Log::size = 0
private

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