-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug_template.cpp
More file actions
32 lines (26 loc) · 845 Bytes
/
debug_template.cpp
File metadata and controls
32 lines (26 loc) · 845 Bytes
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
// Way_1 Press F5 to use Debugger is RECOMMENDED
#include <iostream>
// Way_2 or you can choose a Logger for logging what has happened
#include <plog/Log.h>
#include <plog/Initializers/RollingFileInitializer.h>
// Way_3 EVEN you can use the cerr to print out the states by yourself
// #define ENABLE_DEBUG
int getValue()
{
// The statement that is used for debugging doesn't need to indent
// cerr for debugging, Print out the state the function and the value of output
// #ifdef ENABLE_DUBUG
// std::cerr << "getValue() called\n";
// #endif
PLOGD << "getUserInput() called";
return 5;
}
int main()
{
// Don't indent here
//std::cerr << "main() Called\n";
plog::init(plog::none, "Debug_template_Logfile.txt");
PLOGD << "main() Called";
std::cout << getValue() << std::endl;
return 0;
}