* Main systemd-journald interface for retrieving and parsing log events */
| 168 | * Main systemd-journald interface for retrieving and parsing log events |
| 169 | */ |
| 170 | class Parse |
| 171 | { |
| 172 | public: |
| 173 | /** |
| 174 | * Supported filter types to narrow down the log entry retrival |
| 175 | */ |
| 176 | enum class FilterType : uint8_t |
| 177 | { |
| 178 | TIMESTAMP, |
| 179 | LOGTAG, |
| 180 | SESSION_TOKEN, |
| 181 | OBJECT_PATH, |
| 182 | SENDER, |
| 183 | INTERFACE |
| 184 | }; |
| 185 | |
| 186 | |
| 187 | |
| 188 | /** |
| 189 | * Base Log::Journald::Parser exception |
| 190 | * |
| 191 | * Used to throw generic error messages |
| 192 | * |
| 193 | */ |
| 194 | class Exception : public std::exception |
| 195 | { |
| 196 | public: |
| 197 | Exception(const std::string &err); |
| 198 | |
| 199 | const char *what() const noexcept; |
| 200 | |
| 201 | protected: |
| 202 | Exception(); |
| 203 | std::string errmsg = {}; |
| 204 | }; |
| 205 | |
| 206 | |
| 207 | |
| 208 | /** |
| 209 | * Log::Journal::Parser exception used when there are |
| 210 | * issues with preparing log filter settings. |
| 211 | * |
| 212 | * This is a subclass of Log::Journald:Parser::Exception |
| 213 | */ |
| 214 | class FilterException : public Exception |
| 215 | { |
| 216 | public: |
| 217 | FilterException(const std::string &err); |
| 218 | FilterException(const FilterType ft, const std::string &match); |
| 219 | }; |
| 220 | |
| 221 | |
| 222 | // |
| 223 | // Log::Journald::Parse |
| 224 | // |
| 225 | |
| 226 | Parse(); |
| 227 | virtual ~Parse() noexcept; |