-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
39 lines (31 loc) · 1.02 KB
/
main.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
#include "config.h"
#include "mainwindow.h"
#include <QApplication>
#include "qlogger/qloghandler.h"
#include "sinks/loggerqt.h"
/*****************************/
/* Macro definitions */
/*****************************/
#define APP_LOG_FILE "logs/log.txt"
#define APP_LOG_NB_FILES 3
#define APP_LOG_SIZE (1024 * 1024 * 5) // Equals 5 megabytes (Mb)
#define APP_LOG_ENABLE_CONSOLE true
/*****************************/
/* Main method */
/*****************************/
int main(int argc, char *argv[])
{
/* Set logs */
// Library dependencies
LoggerQt libLogger;
libra::LogManager::setLogger(&libLogger);
// Application
QLogger::QLogHandler::instance().init(APP_LOG_FILE, APP_LOG_NB_FILES, APP_LOG_SIZE, APP_LOG_ENABLE_CONSOLE);
/* Manage application properties */
QApplication app(argc, argv);
app.setApplicationName(PROJECT_NAME);
app.setApplicationVersion(PROJECT_VERSION);
MainWindow mainWindow;
mainWindow.show();
return app.exec();
}