19#include <ThirdPartyWarningsDisable.h>
21#include <ThirdPartyWarningsRestore.h>
23ML_UTILS_START_NAMESPACE
47#define mlFatalError(FUNCTION, ...) \
48 ML_NAMESPACE::internal::LogCollector(__FILE__, __LINE__, ML_FATAL, ML_NAMESPACE::internal::LogCollector::getErrorCode(__VA_ARGS__) ,FUNCTION).getStream()
52#define mlError(FUNCTION, ...) \
53 ML_NAMESPACE::internal::LogCollector(__FILE__, __LINE__, ML_ERROR, ML_NAMESPACE::internal::LogCollector::getErrorCode(__VA_ARGS__) , FUNCTION).getStream()
57#define mlWarning(FUNCTION, ...) \
58 ML_NAMESPACE::internal::LogCollector(__FILE__, __LINE__, ML_WARNING, ML_NAMESPACE::internal::LogCollector::getErrorCode(__VA_ARGS__) , FUNCTION).getStream()
62#define mlInfo(FUNCTION) \
63 ML_NAMESPACE::internal::LogCollector(__FILE__, __LINE__, ML_INFORMATION, ML_RESULT_OK, FUNCTION).getStream()
67#define mlFatalErrorWithDump(FUNCTION, ERRORCODE, OBJECT) \
68 ML_NAMESPACE::internal::LogCollector(__FILE__, __LINE__, ML_FATAL, ERRORCODE, FUNCTION, (OBJECT), ML_NAMESPACE::internal::MLSecureGetRuntimeTypeId((OBJECT))).getStream()
71#define mlErrorWithDump(FUNCTION, ERRORCODE, OBJECT) \
72 ML_NAMESPACE::internal::LogCollector(__FILE__, __LINE__, ML_ERROR, ERRORCODE, FUNCTION, (OBJECT), ML_NAMESPACE::internal::MLSecureGetRuntimeTypeId((OBJECT))).getStream()
75#define mlWarningWithDump(FUNCTION, ERRORCODE, OBJECT) \
76 ML_NAMESPACE::internal::LogCollector(__FILE__, __LINE__, ML_WARNING, ERRORCODE, FUNCTION, (OBJECT), ML_NAMESPACE::internal::MLSecureGetRuntimeTypeId((OBJECT))).getStream()
79#define mlInfoWithDump(FUNCTION, OBJECT) \
80 ML_NAMESPACE::internal::LogCollector(__FILE__, __LINE__, ML_INFORMATION, ML_RESULT_OK, FUNCTION, (OBJECT), ML_NAMESPACE::internal::MLSecureGetRuntimeTypeId((OBJECT))).getStream()
84#ifndef DOXYGEN_SHOULD_SKIP_THIS
91inline const RuntimeType* MLSecureGetRuntimeTypeId(
const T*
object) {
92 const RuntimeType* type =
nullptr;
95 type =
object->getTypeId();
102#pragma warning( push )
104#pragma warning(disable : 4251 )
113 const char *functionName,
114 const void *dumpObj =
nullptr,
115 const RuntimeType *dumpObjRT=
nullptr);
121 std::ostringstream& getStream() {
return _stream; }
124 static int getErrorCode(
int code) {
return code; }
128 std::ostringstream _stream;
133 const char* _functionName;
134 const void *_dumpObj;
135 const RuntimeType *_dumpObjRT;
139#pragma warning( pop )
146ML_UTILS_END_NAMESPACE
#define ML_BAD_PARAMETER
A bad/invalid parameter (or even an inappropriate image) has been passed to a module or an algorithm;...
MLint32 MLErrorCode
Type of an ML Error code.
MLMessageType
Message types handled by the ErrorOutput class.
#define ML_UTILS_EXPORT
Defines platform dependent DLL export macro for mlUtils.