forked from marlinprotocol/NetSim
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
37 lines (27 loc) · 1.01 KB
/
main.cpp
File metadata and controls
37 lines (27 loc) · 1.01 KB
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
#include <cstdio>
#include "./core/Simulator/Simulator.h"
#include "./helpers/Logger/easylogging.h"
using namespace std;
INITIALIZE_EASYLOGGINGPP
void configureLogger() {
// Load configuration from file
el::Configurations conf1("./config/Logger-conf1.conf");
el::Configurations networkTopologyConf("./config/Logger-networkTopology.conf");
// Reconfigure default logger
el::Loggers::reconfigureLogger("default", conf1);
// Register another logger apart from default
el::Logger* networkTopologyLogger = el::Loggers::getLogger("networkTopology");
// Reconfigure networkTopology logger
el::Loggers::reconfigureLogger("networkTopology", networkTopologyConf);
}
int main() {
configureLogger();
LOG(INFO) << "[NetworkSimulator " << "v0.1 started]";
Simulator simulator;
simulator.setup();
simulator.start();
LOG(INFO) << "[NetworkSimulator stopped]";
// Flush all loggers otherwise sometimes program closes and not every log gets printed
el::Loggers::flushAll();
return 0;
}