Skip to content
Snippets Groups Projects
Commit c20c7445 authored by littletux89@gmail.com's avatar littletux89@gmail.com
Browse files

[*] Added virtual method for parsing log node file.

parent e87f12d4
No related branches found
No related tags found
No related merge requests found
#include "DapLogReader.h"
DapLogReader::DapLogReader(QObject *parent) : QObject(parent)
{
}
QList<QString> DapLogReader::request(int aiTimeStamp, int aiRowCount)
QStringList DapLogReader::parse(const QByteArray &aLogMessages)
{
auto list = QString::fromLatin1(aLogMessages).split(";");
for(QString l : list)
{
if(l.contains("["))
qDebug() << l;
}
return list;
}
QStringList DapLogReader::request(int aiTimeStamp, int aiRowCount)
{
QList<QString> str;
QByteArray result;
QProcess process;
process.start(QString("%1 print_log ts_after %2 limit %3").arg("/home/andrey/Demlabs/build-kelvin-node/kelvin-node-cli").arg(aiTimeStamp).arg(aiRowCount));
......@@ -19,7 +33,6 @@ QList<QString> DapLogReader::request(int aiTimeStamp, int aiRowCount)
else
{
qDebug() << "TRUE";
qDebug() << QString::fromLatin1(result);
}
return str;
return parse(result);
}
......@@ -9,7 +9,8 @@
class DapLogReader : public QObject
{
Q_OBJECT
protected:
virtual QStringList parse(const QByteArray& aLogMessages);
public:
explicit DapLogReader(QObject *parent = nullptr);
......@@ -17,7 +18,7 @@ signals:
public slots:
QList<QString> request(int aiTimeStamp, int aiRowCount);
QStringList request(int aiTimeStamp, int aiRowCount);
};
#endif // DAPLOGREADER_H
......@@ -37,8 +37,6 @@ int main(int argc, char *argv[])
//#endif
DapLogReader dapLogReader;
auto var = dapLogReader.request(0, 100);
auto var1 = dapLogReader.request(1, 100);
auto var2 = dapLogReader.request(2, 100);
// Creating the main application object
DapChainDashboardService service;
service.start();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment