diff options
author | saturneric <[email protected]> | 2024-07-26 16:24:34 +0000 |
---|---|---|
committer | saturneric <[email protected]> | 2024-07-26 16:24:34 +0000 |
commit | 37a62a8d0b590710b902376ca3320cc05e954b63 (patch) | |
tree | 349ecff21e5cf53d8eedbae7886404417ecdad05 /src/main.cpp | |
parent | fix: correct urls at appdata.xml (diff) | |
download | GpgFrontend-37a62a8d0b590710b902376ca3320cc05e954b63.tar.gz GpgFrontend-37a62a8d0b590710b902376ca3320cc05e954b63.zip |
feat: remove spdlog and clean up log
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/main.cpp b/src/main.cpp index a99f3e30..8ab17a40 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -50,6 +50,18 @@ auto main(int argc, char* argv[]) -> int { argc, argv); ctx->InitApplication(); + qSetMessagePattern( + "[%{time yyyyMMdd h:mm:ss.zzz}] [%{category}] " + "[%{if-debug}D%{endif}%{if-info}I%{endif}%{if-warning}W%{endif}%{if-" + "critical}C%{endif}%{if-fatal}F%{endif}] [%{threadid}] %{file}:%{line} - " + "%{message}"); + +#ifdef RELEASE + QLoggingCategory::setFilterRules("*.debug=false\n*.info=false\n"); +#else + QLoggingCategory::setFilterRules("*.debug=false"); +#endif + auto rtn = 0; // initialize qt resources @@ -67,14 +79,12 @@ auto main(int argc, char* argv[]) -> int { parser.process(*ctx->GetApp()); - ctx->log_level = spdlog::level::info; - if (parser.isSet("v")) { return GpgFrontend::PrintVersion(); } if (parser.isSet("l")) { - ctx->log_level = GpgFrontend::ParseLogLevel(parser.value("l")); + GpgFrontend::ParseLogLevel(parser.value("l")); } if (parser.isSet("t")) { |