From 3d162f03366876dbb22be88cbbbdf6be4bd7314d Mon Sep 17 00:00:00 2001 From: Dan Paulat Date: Wed, 13 Apr 2022 20:09:00 -0500 Subject: [PATCH] Update main_window.cpp to use spdlog instead of boost log --- scwx-qt/source/scwx/qt/main/main_window.cpp | 18 ++++++++---------- scwx-qt/ts/scwx_en_US.ts | 2 +- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/scwx-qt/source/scwx/qt/main/main_window.cpp b/scwx-qt/source/scwx/qt/main/main_window.cpp index fd237a56..cef54578 100644 --- a/scwx-qt/source/scwx/qt/main/main_window.cpp +++ b/scwx-qt/source/scwx/qt/main/main_window.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include @@ -17,8 +18,6 @@ #include #include -#include - namespace scwx { namespace qt @@ -26,7 +25,8 @@ namespace qt namespace main { -static const std::string logPrefix_ = "[scwx::qt::main::main_window] "; +static const std::string logPrefix_ = "scwx::qt::main::main_window"; +static const auto logger_ = util::Logger::Create(logPrefix_); class MainWindowImpl : public QObject { @@ -51,10 +51,9 @@ public: { if (!std::filesystem::create_directories(appDataPath)) { - BOOST_LOG_TRIVIAL(error) - << logPrefix_ - << "Unable to create application local data directory: \"" - << appDataPath << "\""; + logger_->error( + "Unable to create application local data directory: \"{}\"", + appDataPath); } } @@ -253,7 +252,7 @@ void MainWindow::on_actionOpen_triggered() this, [=](const QString& file) { - BOOST_LOG_TRIVIAL(info) << "Selected: " << file.toStdString(); + logger_->info("Selected: {}", file.toStdString()); std::shared_ptr request = std::make_shared(); @@ -397,8 +396,7 @@ void MainWindowImpl::SelectRadarProduct(map::MapWidget* mapWidget, { const std::string& productName = common::GetLevel2Name(product); - BOOST_LOG_TRIVIAL(debug) - << logPrefix_ << "Selecting Level 2 radar product: " << productName; + logger_->debug("Selecting Level 2 radar product: {}", productName); if (mapWidget == activeMap_) { diff --git a/scwx-qt/ts/scwx_en_US.ts b/scwx-qt/ts/scwx_en_US.ts index 35c2eac2..925f53ac 100644 --- a/scwx-qt/ts/scwx_en_US.ts +++ b/scwx-qt/ts/scwx_en_US.ts @@ -102,7 +102,7 @@ scwx::qt::main::MainWindow - + Unrecognized NEXRAD Product: