-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDebug.cpp
56 lines (41 loc) · 1.01 KB
/
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/////////////////
// OS Includes
#include <stdlib.h>
//////////////
// Includes
#include "Debug.h"
/////////////
// Defines
///////////////////////////
// Static Initialization
Debug Debug::xDebugger;
//////////////////////////////////////////////////////////////////////////////////////////////////
// Public Methods
Debug::Debug()
{
#ifndef NDEBUG
cerr << "c Debugging is ON." << endl;
#endif
/*
#ifdef MEM_DEBUG
cerr << "c Memory debugging is ON (output appears in memtrace.log after termination)." << endl;
Memtrace::init();
#endif
*/
}
Debug::~Debug()
{
#ifdef MEM_DEBUG
Memtrace::term();
#endif
}
/*static*/ void Debug::vErrorReport(char* aError_)
{
// Report an error and halt program execution
cerr << "Fatal error: " << aError_ << endl;
exit(1);
}
//////////////////////////////////////////////////////////////////////////////////////////////////
// Protected Methods
//////////////////////////////////////////////////////////////////////////////////////////////////
// Private Methods