QtHPConnect/errorhandler.h

40 lines
687 B
C
Raw Normal View History

2019-02-10 14:32:15 +01:00
#ifndef ERRORHANDLER_H
#define ERRORHANDLER_H
#include <QObject>
2019-02-10 14:43:00 +01:00
#include <QFile>
#include <QTextStream>
#include <QMutexLocker>
#include <QDateTime>
#include <QDebug>
#include <mainwindow.h>
enum ErrLevel {
L0, //abort
L1, //fault
L2, //warning
L3,
L4,
L7 //information
};
class errorHandler {
private:
QObject * pParent;
QMutex m_lineLoggerMutex;
QString getLogFileName();
int writeLog(QString);
int writeStatus(QString);
int writeChatter(QString);
2019-02-10 14:32:15 +01:00
public:
errorHandler();
2019-02-10 14:43:00 +01:00
errorHandler(QObject *);
int error(ErrLevel, int, QString, QString Data);
int dump(uint8_t *, int);
2019-02-10 14:32:15 +01:00
};
2019-02-10 14:43:00 +01:00
#endif // ERRORHANDLER_H