-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDebug.cpp
34 lines (31 loc) · 964 Bytes
/
Debug.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include "Debug.h"
#include "Logger.h"
#include <iostream>
#include <cstdlib>
void __assert(bool assertion, const char *text, int line, const char *file)
{
if (!assertion)
{
char msg[100];
sprintf(msg, "An assertion failed in \"%s\" on line %d: %s\n", file, line, text);
logger.log(LOG_FILE | LOG_USER, msg);
exit(1);
}
}
void __assert(bool assertion, const char *text, const char *description, int line, const char *file)
{
if (!assertion)
{
char msg[100];
sprintf(msg, "An assertion failed in \"%s\" on line %d: %s\n\nDescription: %s", file, line, text, description);
logger.log(LOG_FILE | LOG_USER, msg);
exit(1);
}
}
void __assert(const char *description, int line, const char *file)
{
char msg[100];
sprintf(msg, "An assertion failed in \"%s\" on line %d.\n\nDescription: %s", file, line, description);
logger.log(LOG_FILE | LOG_USER, msg);
exit(1);
}