-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsermon.cpp
More file actions
45 lines (38 loc) · 891 Bytes
/
sermon.cpp
File metadata and controls
45 lines (38 loc) · 891 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
33
34
35
36
37
38
39
40
41
42
43
44
/**
*************************************************************
* @file sermon.cpp
* @brief Server Monitor
*
* @author Gaspar Fernández <blakeyed@totaki.com>
* @version
* @date 09 dic 2015
* Historial de cambios:
*
* Ya se irá mejorando el código. Por ahora, para salir del paso podemos
* dejarlo así
*
*************************************************************/
#include <iostream>
#include <memory>
#include "sermon_exception.hpp"
#include "sermon_app.hpp"
#include "lib/tcolor.hpp"
#include <thread>
int main(int argc, char *argv[])
{
std::shared_ptr<Sermon> s;
try
{
if (argc>1)
s = std::make_shared<Sermon>(argv[1]);
else
s = std::make_shared<Sermon>();
}
catch (SermonException &e)
{
std::cout << TColor(TColor::RED) << "Error: "<<e.what() << endColor << std::endl;
return 1;
}
s-> monitoring();
return EXIT_SUCCESS;
}