38#include "OMSimulator/Types.h"
50 void Info(
const std::string &msg);
51 oms_status_enu_t
Warning(
const std::string &msg);
52 oms_status_enu_t
Error(
const std::string &msg,
const std::string &function);
57 void Debug(
const std::string &msg);
58 void Trace(
const std::string &function,
const std::string &file,
const long line);
61 void ProgressBar(
double start,
double stop,
double value);
64 void SetCallback(
void (*cb)(oms_message_type_enu_t type,
const char *message));
65 oms_status_enu_t
SetLogFile(
const std::string &filename);
74#define logInfo(msg) oms::Log::Internal::Info(msg)
75#define logWarning(msg) oms::Log::Internal::Warning(msg)
76#define logError(msg) oms::Log::Internal::Error(msg, __func__)
79 #define logDebugEnabled() oms::Log::Internal::DebugEnabled()
80 #define logTraceEnabled() oms::Log::Internal::TraceEnabled()
82 #define logDebug(msg) oms::Log::Internal::Debug(msg)
83 #define logTrace() oms::Log::Internal::Trace(__func__, __FILE__, __LINE__)
85 #define logDebugEnabled() (false)
86 #define logTraceEnabled() (false)
88 #define logDebug(msg) ((void)0)
89 #define logTrace() ((void)0)
93#define logError_AlreadyInScope(cref) logError("\"" + std::string(cref) + "\" already exists in the scope")
94#define logError_BusAndConnectorNotSameModel(bus, connector) logError("Bus \"" + std::string(bus) + "\" and connector \"" + std::string(connector) + "\" do not belong to same model")
95#define logError_BusAndConnectorNotSameSystem(bus, connector) logError("Bus \"" + std::string(bus) + "\" and connector \"" + std::string(connector) + "\" do not belong to same system")
96#define logError_BusNotInComponent(cref, component) logError("Bus connector \"" + std::string(cref) + "\" not found in component \"" + std::string(component->getFullCref()) + "\"")
97#define logError_BusNotInSystem(cref, system) logError("Bus connector \"" + std::string(cref) + "\" not found in system \"" + std::string(system->getFullCref()) + "\"")
98#define logError_ComponentNotInSystem(system, component) logError("System \"" + std::string(system->getFullCref()) + "\" does not contain component \"" + std::string(component) + "\"")
99#define logError_ConnectionExistsAlready(crefA, crefB, system) logError("Connection <\"" + std::string(crefA) + "\", \"" + std::string(crefB) + "\"> exists already in system \"" + std::string(system->getFullCref()) + "\"")
100#define logError_ConnectionNotInSystem(crefA, crefB, system) logError("Connection <\"" + std::string(crefA) + "\", \"" + std::string(crefB) + "\"> not found in system \"" + std::string(system->getFullCref()) + "\"")
101#define logError_ConnectorNotInComponent(cref, component) logError("Connector \"" + std::string(cref) + "\" not found in component \"" + std::string(component->getFullCref()) + "\"")
102#define logError_ConnectorNotInSystem(cref, system) logError("Connector \"" + std::string(cref) + "\" not found in system \"" + std::string(system->getFullCref()) + "\"")
103#define logError_FMUCall(call, fmu) logError(std::string(call) + " failed for FMU \"" + std::string(fmu->getFullCref()) + "\"")
104#define logError_Initialization(system) logError("Initialization of system \"" + std::string(system) + "\" failed")
105#define logError_InternalError logError("internal error")
106#define logError_InvalidIdent(cref) logError("\"" + std::string(cref) + "\" is not a valid ident")
107#define logError_InvalidIdent(cref) logError("\"" + std::string(cref) + "\" is not a valid ident")
108#define logError_ModelInWrongState(cref) logError("Model \"" + std::string(cref) + "\" is in wrong model state")
109#define logError_ModelNotInScope(cref) logError("Model \"" + std::string(cref) + "\" does not exist in the scope")
110#define logError_NotForScSystem logError("Not available for strongly coupled systems")
111#define logError_NotImplemented logError("Not implemented")
112#define logError_OnlyForModel logError("Only implemented for model identifiers")
113#define logError_OnlyForRealInputs(cref) logError("Signal \"" + std::string(cref) + "\" is not a real input signal")
114#define logError_OnlyForSystemWC logError("Only available for WC systems")
115#define logError_ResetFailed(system) logError("failed to reset system \"" + std::string(system) + "\" to instantiation mode")
116#define logError_SubSystemNotInSystem(system, subsystem) logError("System \"" + std::string(system) + "\" does not contain subsystem \"" + std::string(subsystem) + "\"")
117#define logError_SystemNotInModel(model, system) logError("Model \"" + std::string(model) + "\" does not contain system \"" + std::string(system) + "\"")
118#define logError_Termination(system) logError("Termination of system \"" + std::string(system) + "\" failed")
119#define logError_UnknownSignal(cref) logError("Unknown signal \"" + std::string(cref) + "\"")
120#define logError_WrongSchema(name) logError("Wrong xml schema detected. Unexpected tag \"" + name + "\"")
121#define logWarning_deprecated logWarning("Wrong/deprecated content detected but successfully loaded. Please re-export the SSP file to avoid this message.")
bool DebugEnabled()
Definition Logging.cpp:207
void Info(const std::string &msg)
Definition Logging.cpp:164
oms_status_enu_t Error(const std::string &msg, const std::string &function)
Definition Logging.cpp:191
void Trace(const std::string &function, const std::string &file, const long line)
Definition Logging.cpp:232
void Debug(const std::string &msg)
Definition Logging.cpp:212
bool TraceEnabled()
Definition Logging.cpp:227
oms_status_enu_t Warning(const std::string &msg)
Definition Logging.cpp:176
oms_status_enu_t SetLoggingLevel(int logLevel)
Definition Logging.cpp:287
void ProgressBar(double start, double stop, double value)
Definition Logging.cpp:317
void TerminateBar()
Definition Logging.cpp:345
void SetCallback(void(*cb)(oms_message_type_enu_t type, const char *message))
Definition Logging.cpp:312
oms_status_enu_t SetLogFile(const std::string &filename)
Definition Logging.cpp:249
const int GetLoggingLevel()
Definition Logging.cpp:302
void SetMaxLogFileSize(const unsigned long size)
Definition Logging.cpp:307