1 /*
2     SPDX-FileCopyrightText: 2007 Nicolas Ternisien <nicolas.ternisien@gmail.com>
3 
4     SPDX-License-Identifier: GPL-2.0-or-later
5 */
6 
7 #pragma once
8 
9 #include "fileAnalyzer.h"
10 
11 #include "localLogFileReader.h"
12 #include "parsingHelper.h"
13 #include "xorgLogMode.h"
14 
15 #define CONFIG_FILE_LOG_LEVEL_ICON "configure"
16 #define DEFAULT_SETTING_LOG_LEVEL_ICON "configure-toolbars"
17 #define COMMAND_LINE_LOG_LEVEL_ICON "konsole"
18 #define PROBED_LOG_LEVEL_ICON "favorites"
19 #define NOT_IMPLEMENTED_LOG_LEVEL_ICON "document-new"
20 
21 class XorgAnalyzer : public FileAnalyzer
22 {
23     Q_OBJECT
24 
25 public:
26     explicit XorgAnalyzer(LogMode *logMode);
27 
28     ~XorgAnalyzer() override;
29 
30     LogViewColumns initColumns() override;
31 
32 protected:
33     LogFileReader *createLogFileReader(const LogFile &logFile) override;
34 
35     Analyzer::LogFileSortMode logFileSortMode() override;
36 
37     LogLine *parseMessage(const QString &logLine, const LogFile &originalFile) override;
38 
39 private:
40     void initializeTypeName();
41 
42     LogLevel *findTypeName(const QString &type);
43 
44     QMap<QString, LogLevel *> mXorgLevels;
45     const QDateTime mCurrentDateTime;
46 };
47 
48