File: logfileparser.h

package info (click to toggle)
deepin-log-viewer 6.5.8%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 14,752 kB
  • sloc: cpp: 61,723; ansic: 1,732; xml: 81; sh: 59; makefile: 12
file content (122 lines) | stat: -rw-r--r-- 3,844 bytes parent folder | download | duplicates (2)
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later

#ifndef LOGFILEPARSER_H
#define LOGFILEPARSER_H

#include "journalwork.h"
#include "journalbootwork.h"
#include "logapplicationparsethread.h"
#include "logauththread.h"
#include "dbusproxy/dldbushandler.h"
#include "dbusproxy/dldbusinterface.h"
#include "logoocfileparsethread.h"

#include <QMap>
#include <QThread>
#include <QDebug>

class LogFileParser : public QObject
{
    Q_OBJECT
public:
    explicit LogFileParser(QWidget *parent = nullptr);
    ~LogFileParser();


    int parseByJournal(const QStringList &arg = QStringList());
    int parseByJournalBoot(const QStringList &arg = QStringList());

    int parseByDpkg(const DKPG_FILTERS &iDpkgFilter);

    int parseByXlog(const XORG_FILTERS &iXorgFilter);
    int parseByBoot();
    // 通用解析入口,传入筛选参数,解析线程根据筛选参数吐出日志数据
    int parse(LOG_FILTER_BASE &filter);
    int parseByKern(const KERN_FILTERS &iKernFilter);
    int parseByApp(const APP_FILTERS &iAPPFilter);
    void parseByDnf(DNF_FILTERS iDnfFilter);
    void parseByDmesg(DMESG_FILTERS iDmesgFilter);
    int parseByNormal(const NORMAL_FILTERS &iNormalFiler);   // add by Airy

    int parseByKwin(const KWIN_FILTERS &iKwinfilter);
    int parseByOOC(const QString &path);

    int parseByAudit(const AUDIT_FILTERS &iAuditFilter);

    int parseByCoredump(const COREDUMP_FILTERS &iCoredumpFilter, bool parseMap = false);

    void stopAllLoad();

signals:
    void parseFinished(int index, LOG_FLAG type, int status);
    void logData(int index, const QList<QString> &dataList, LOG_FLAG type);
    void stop();

    void dpkgFinished(int index);
    void dpkgData(int index, QList<LOG_MSG_DPKG>);
    void xlogFinished(int index);
    void xlogData(int index, QList<LOG_MSG_XORG>);
    void bootFinished(int index);
    void bootData(int index, QList<LOG_MSG_BOOT>);
    void kernFinished(int index);
    void kernData(int index, QList<LOG_MSG_JOURNAL>);
    void dnfFinished(QList<LOG_MSG_DNF>);
    void dmesgFinished(QList<LOG_MSG_DMESG>);
    void journalFinished(int index);
    void journalBootFinished(int index);
    void journalData(int index, QList<LOG_MSG_JOURNAL>);
    void journaBootlData(int index, QList<LOG_MSG_JOURNAL>);

    //void normalFinished();  // add by Airy

    void normalFinished(int index);
    void normalData(int index, QList<LOG_MSG_NORMAL>);
    void kwinFinished(int index);
    void kwinData(int index, QList<LOG_MSG_KWIN> iKwinList);
    /**
     * @brief appFinished 获取数据结束信号
     */
    void appFinished(int index);
    void appData(int index, QList<LOG_MSG_APPLICATOIN> iDataList);
    void OOCFinished(int index, int error = 0);
    void OOCData(int index, const QString &data);

    void auditFinished(int index, bool bShowTip = false);
    void auditData(int index, QList<LOG_MSG_AUDIT>);

    void coredumpFinished(int index);
    void coredumpData(int index, QList<LOG_MSG_COREDUMP> iDataList);

    void stopKern();
    void stopBoot();
    void stopDpkg();
    void stopXlog();
    void stopNormal();
    void stopKwin();
    void stopApp();
    void stopJournal();
    void stopJournalBoot();
    void stopDnf();
    void stopDmesg();
    void stopOOC();
    void stopCoredump();
    /**
     * @brief proccessError 获取日志文件失败错误信息传递信号,传递到主界面显示 DMessage tooltip
     * @param iError 错误字符
     */
    void proccessError(const QString &iError);

private:
    void quitLogAuththread(QThread *iThread);
signals:

public slots:
    void slog_proccessError(const QString &iError);
private:
    LogOOCFileParseThread *m_OOCThread {nullptr};
    LogApplicationParseThread *m_appThread {nullptr};
};

#endif  // LOGFILEPARSER_H