* @brief This file is the implementation file of assert
*/
#include <stdio.h>
+#include <cstdlib>
+#include <sstream>
#include <stddef.h>
#include <dpl/assert.h>
#include <dpl/colors.h>
-#include <dpl/log/log.h>
-#include <cstdlib>
+#include <dpl/exception.h>
+#include <dpl/log/wrt_log.h>
namespace DPL {
void AssertProc(const char *condition,
int line,
const char *function)
{
-#define INTERNAL_LOG(message) \
- do \
- { \
- std::ostringstream platformLog; \
- platformLog << message; \
- DPL::Log::LogSystemSingleton::Instance().Pedantic( \
- platformLog.str().c_str(), \
- __FILE__, __LINE__, __FUNCTION__); \
- } \
- while (0)
+
+#define INTERNAL_LOG(message) \
+do { \
+ std::ostringstream platformLog; \
+ platformLog << message; \
+ WrtLogE("%s", platformLog.str().c_str()); \
+} while (0)
// Try to log failed assertion to log system
- Try
- {
- INTERNAL_LOG(
- "################################################################################");
- INTERNAL_LOG(
- "### DPL assertion failed! ###");
- INTERNAL_LOG(
- "################################################################################");
+ Try {
+ INTERNAL_LOG("########################################################################");
+ INTERNAL_LOG("### DPL assertion failed! ###");
+ INTERNAL_LOG("########################################################################");
INTERNAL_LOG("### Condition: " << condition);
INTERNAL_LOG("### File: " << file);
INTERNAL_LOG("### Line: " << line);
INTERNAL_LOG("### Function: " << function);
- INTERNAL_LOG(
- "################################################################################");
+ INTERNAL_LOG("########################################################################");
} catch (Exception) {
// Just ignore possible double errors
}