34 #include "OMSimulator/Types.h"
46 void Info(
const std::string &msg);
47 oms_status_enu_t
Warning(
const std::string &msg);
48 oms_status_enu_t
Error(
const std::string &msg,
const std::string &
function);
53 void Debug(
const std::string &msg);
54 void Trace(
const std::string &
function,
const std::string &file,
const long line);
57 void ProgressBar(
double start,
double stop,
double value);
60 void SetCallback(
void (*cb)(oms_message_type_enu_t type,
const char *message));
61 oms_status_enu_t
SetLogFile(
const std::string &filename);
70 #define logInfo(msg) oms::Log::Internal::Info(msg)
71 #define logWarning(msg) oms::Log::Internal::Warning(msg)
72 #define logError(msg) oms::Log::Internal::Error(msg, __func__)
75 #define logDebugEnabled() oms::Log::Internal::DebugEnabled()
76 #define logTraceEnabled() oms::Log::Internal::TraceEnabled()
78 #define logDebug(msg) oms::Log::Internal::Debug(msg)
79 #define logTrace() oms::Log::Internal::Trace(__func__, __FILE__, __LINE__)
81 #define logDebugEnabled() (false)
82 #define logTraceEnabled() (false)
84 #define logDebug(msg) ((void)0)
85 #define logTrace() ((void)0)
89 #define logError_AlreadyInScope(cref) logError("\"" + std::string(cref) + "\" already exists in the scope")
90 #define logError_BusAndConnectorNotSameModel(bus, connector) logError("Bus \"" + std::string(bus) + "\" and connector \"" + std::string(connector) + "\" do not belong to same model")
91 #define logError_BusAndConnectorNotSameSystem(bus, connector) logError("Bus \"" + std::string(bus) + "\" and connector \"" + std::string(connector) + "\" do not belong to same system")
92 #define logError_BusNotInComponent(cref, component) logError("Bus connector \"" + std::string(cref) + "\" not found in component \"" + std::string(component->getFullCref()) + "\"")
93 #define logError_BusNotInSystem(cref, system) logError("Bus connector \"" + std::string(cref) + "\" not found in system \"" + std::string(system->getFullCref()) + "\"")
94 #define logError_ComponentNotInSystem(system, component) logError("System \"" + std::string(system->getFullCref()) + "\" does not contain component \"" + std::string(component) + "\"")
95 #define logError_ConnectionExistsAlready(crefA, crefB, system) logError("Connection <\"" + std::string(crefA) + "\", \"" + std::string(crefB) + "\"> exists already in system \"" + std::string(system->getFullCref()) + "\"")
96 #define logError_ConnectionNotInSystem(crefA, crefB, system) logError("Connection <\"" + std::string(crefA) + "\", \"" + std::string(crefB) + "\"> not found in system \"" + std::string(system->getFullCref()) + "\"")
97 #define logError_ConnectorNotInComponent(cref, component) logError("Connector \"" + std::string(cref) + "\" not found in component \"" + std::string(component->getFullCref()) + "\"")
98 #define logError_ConnectorNotInSystem(cref, system) logError("Connector \"" + std::string(cref) + "\" not found in system \"" + std::string(system->getFullCref()) + "\"")
99 #define logError_FMUCall(call, fmu) logError(std::string(call) + " failed for FMU \"" + std::string(fmu->getFullCref()) + "\"")
100 #define logError_Initialization(system) logError("Initialization of system \"" + std::string(system) + "\" failed")
101 #define logError_InternalError logError("internal error")
102 #define logError_InvalidIdent(cref) logError("\"" + std::string(cref) + "\" is not a valid ident")
103 #define logError_InvalidIdent(cref) logError("\"" + std::string(cref) + "\" is not a valid ident")
104 #define logError_ModelInWrongState(cref) logError("Model \"" + std::string(cref) + "\" is in wrong model state")
105 #define logError_ModelNotInScope(cref) logError("Model \"" + std::string(cref) + "\" does not exist in the scope")
106 #define logError_NotForScSystem logError("Not available for strongly coupled systems")
107 #define logError_NotImplemented logError("Not implemented")
108 #define logError_OnlyForModel logError("Only implemented for model identifiers")
109 #define logError_OnlyForRealInputs(cref) logError("Signal \"" + std::string(cref) + "\" is not a real input signal")
110 #define logError_OnlyForSystemWC logError("Only available for WC systems")
111 #define logError_ResetFailed(system) logError("failed to reset system \"" + std::string(system) + "\" to instantiation mode")
112 #define logError_SubSystemNotInSystem(system, subsystem) logError("System \"" + std::string(system) + "\" does not contain subsystem \"" + std::string(subsystem) + "\"")
113 #define logError_SystemNotInModel(model, system) logError("Model \"" + std::string(model) + "\" does not contain system \"" + std::string(system) + "\"")
114 #define logError_Termination(system) logError("Termination of system \"" + std::string(system) + "\" failed")
115 #define logError_UnknownSignal(cref) logError("Unknown signal \"" + std::string(cref) + "\"")
116 #define logError_WrongSchema(name) logError("Wrong xml schema detected. Unexpected tag \"" + name + "\"")
117 #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:203
void Info(const std::string &msg)
Definition: Logging.cpp:160
oms_status_enu_t Error(const std::string &msg, const std::string &function)
Definition: Logging.cpp:187
void Trace(const std::string &function, const std::string &file, const long line)
Definition: Logging.cpp:228
void Debug(const std::string &msg)
Definition: Logging.cpp:208
bool TraceEnabled()
Definition: Logging.cpp:223
oms_status_enu_t Warning(const std::string &msg)
Definition: Logging.cpp:172
oms_status_enu_t SetLoggingLevel(int logLevel)
Definition: Logging.cpp:283
void ProgressBar(double start, double stop, double value)
Definition: Logging.cpp:313
void TerminateBar()
Definition: Logging.cpp:341
void SetCallback(void(*cb)(oms_message_type_enu_t type, const char *message))
Definition: Logging.cpp:308
oms_status_enu_t SetLogFile(const std::string &filename)
Definition: Logging.cpp:245
const int GetLoggingLevel()
Definition: Logging.cpp:298
void SetMaxLogFileSize(const unsigned long size)
Definition: Logging.cpp:303