2023-11-30 21:31:41 +03:00
|
|
|
#include "src/utils/environment.h"
|
|
|
|
#include "src/utils/file_parser.h"
|
2023-11-30 20:54:31 +03:00
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
int main() {
|
2023-11-30 21:31:41 +03:00
|
|
|
const char *envVar = getEnvVar("PATH");
|
2023-11-30 20:54:31 +03:00
|
|
|
|
2023-11-30 21:31:41 +03:00
|
|
|
// try opening the log file
|
2023-11-30 20:54:31 +03:00
|
|
|
try {
|
|
|
|
std::string filePath = "/tmp/hypr/" + std::string(envVar);
|
|
|
|
std::vector<std::string> errLines = readErrLines(filePath);
|
|
|
|
|
2023-11-30 21:31:41 +03:00
|
|
|
// print [ERR] lines, which are caught errors that we prioritize
|
2023-11-30 20:54:31 +03:00
|
|
|
for (const auto &line : errLines) {
|
|
|
|
std::cout << line << std::endl;
|
|
|
|
}
|
|
|
|
} catch (const std::runtime_error &e) {
|
|
|
|
std::cerr << "Error: " << e.what() << std::endl;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|