#ifndef LINBOLOGGER_H #define LINBOLOGGER_H #include #include #include class LinboLogger : public QObject { Q_OBJECT Q_PROPERTY(LinboLog latestLog READ getLatestLog NOTIFY latestLogChanged) public: friend class LinboBackend; enum LinboLogType { UnknownLogType = -1, StdOut, StdErr, LinboGuiInfo, LinboGuiError }; typedef struct { QString message; LinboLogType type; QDateTime time; } LinboLog; const LinboLog& getLatestLog(); QString logTypeToString(LinboLogType logType); private: explicit LinboLogger(QObject *parent = nullptr); void log(QString logText, LinboLogType logType); QList logHistory; signals: void latestLogChanged(const LinboLogger::LinboLog& latestLog); }; #endif // LINBOLOGGER_H