forked from blackfiveimaging/library
-
Notifications
You must be signed in to change notification settings - Fork 0
/
debugtest.cpp
44 lines (32 loc) · 944 Bytes
/
debugtest.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
#include "debug.h"
#include <cstdlib>
using namespace std;
int main(int argc,char **argv)
{
DebugLevel level=WARN;
if(argc>1)
level=DebugLevel(atoi(argv[1]));
Debug.SetLevel(level);
Debug[ERROR] << "Debugging..." << endl;
Debug[WARN] << "Warning..." << endl;
Debug[COMMENT] << "Commenting..." << endl;
Debug[TRACE] << "Tracing..." << endl;
Debug.PushLevel(TRACE);
Debug[ERROR] << "Debugging..." << endl;
Debug[WARN] << "Warning..." << endl;
Debug[COMMENT] << "Commenting..." << endl;
Debug[TRACE] << "Tracing..." << endl;
Debug.PopLevel();
Debug[ERROR] << "Debugging..." << endl;
Debug[WARN] << "Warning..." << endl;
Debug[COMMENT] << "Commenting..." << endl;
Debug[TRACE] << "Tracing..." << endl;
if(argc>2)
{
Debug.SetLogFile(argv[2]);
Debug[ERROR] << "Debugging..." << endl;
Debug[WARN] << "Warning..." << endl;
Debug[COMMENT] << "Commenting..." << endl;
Debug[TRACE] << "Tracing..." << endl;
}
}