core/log: add read-log --no-time

This commit is contained in:
outfoxxed 2024-08-09 23:58:30 -07:00
parent c2b4610acb
commit 53b8f1ee0b
Signed by untrusted user: outfoxxed
GPG key ID: 4C88A185FB89301E
3 changed files with 7 additions and 4 deletions

View file

@ -142,6 +142,8 @@ int qs_main(int argc, char** argv) {
/// ---
QStringOption logPath;
QStringOption logFilter;
auto logNoTime = false;
auto* readLog = app.add_subcommand("read-log", "Read a quickshell log file.");
readLog->add_option("path", logPath, "Path to the log file to read")->required();
@ -151,6 +153,7 @@ int qs_main(int argc, char** argv) {
"Logging categories to display. (same syntax as QT_LOGGING_RULES)"
);
readLog->add_flag("--no-time", logNoTime, "Do not print timestamps of log messages.");
readLog->add_flag("--no-color", noColor, "Do not color the log output. (Env:NO_COLOR)");
CLI11_PARSE(app, argc, argv);
@ -169,7 +172,7 @@ int qs_main(int argc, char** argv) {
qInfo() << "Reading log" << *logPath;
}
return qs::log::readEncodedLogs(&file, *logFilter) ? 0 : -1;
return qs::log::readEncodedLogs(&file, !logNoTime, *logFilter) ? 0 : -1;
} else {
// NOLINTBEGIN