-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.cpp
40 lines (30 loc) · 811 Bytes
/
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
40
#include <QCoreApplication>
#include <QDebug>
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include "modbusparser.h"
#include "debuglogger.h"
DebugLogger * debuglogger = 0;
#ifdef BUILD_DEVICE
#include "logger.h"
Logger logger;
#endif
void MessageOutput(QtMsgType type, const QMessageLogContext& context, const QString &message)
{
Q_UNUSED(type);
Q_UNUSED(context);
QString msg = message;
msg += QString("\n");
OutputDebugString(reinterpret_cast<const wchar_t *>(msg.utf16()));
debuglogger->write(message);
}
int main(int argc, char *argv[])
{
debuglogger = DebugLogger_Instance();
debuglogger->setFile("parsing-log.txt");
qInstallMessageHandler(MessageOutput);
ModbusParser parser;
QCoreApplication app(argc, argv);
return app.exec();
}