Removing boost log from Boost.Log -> spdlog - settings, types, util, view

This commit is contained in:
Dan Paulat 2022-04-19 16:01:45 -05:00
parent e6bddc79db
commit c6281d799f
13 changed files with 109 additions and 127 deletions

View file

@ -1,9 +1,9 @@
#include <scwx/qt/view/level2_product_view.hpp>
#include <scwx/common/constants.hpp>
#include <scwx/util/logger.hpp>
#include <scwx/util/threads.hpp>
#include <scwx/util/time.hpp>
#include <boost/log/trivial.hpp>
#include <boost/range/irange.hpp>
#include <boost/timer/timer.hpp>
@ -14,7 +14,8 @@ namespace qt
namespace view
{
static const std::string logPrefix_ = "[scwx::qt::view::level2_product_view] ";
static const std::string logPrefix_ = "scwx::qt::view::level2_product_view";
static const auto logger_ = scwx::util::Logger::Create(logPrefix_);
static constexpr uint16_t RANGE_FOLDED = 1u;
static constexpr uint32_t VERTICES_PER_BIN = 6u;
@ -73,8 +74,8 @@ public:
}
else
{
BOOST_LOG_TRIVIAL(warning) << logPrefix_ << "Unknown product: \""
<< common::GetLevel2Name(product) << "\"";
logger_->warn("Unknown product: \"{}\"",
common::GetLevel2Name(product));
dataBlockType_ = wsr88d::rda::DataBlockType::Unknown;
}
}
@ -347,7 +348,7 @@ void Level2ProductView::UpdateColorTable()
void Level2ProductView::ComputeSweep()
{
BOOST_LOG_TRIVIAL(debug) << logPrefix_ << "ComputeSweep()";
logger_->debug("ComputeSweep()");
boost::timer::cpu_timer timer;
@ -382,8 +383,8 @@ void Level2ProductView::ComputeSweep()
if (momentData0 == nullptr)
{
BOOST_LOG_TRIVIAL(warning) << logPrefix_ << "No moment data for "
<< common::GetLevel2Name(p->product_);
logger_->warn("No moment data for {}",
common::GetLevel2Name(p->product_));
return;
}
@ -462,8 +463,7 @@ void Level2ProductView::ComputeSweep()
if (momentData0->data_word_size() != momentData->data_word_size())
{
BOOST_LOG_TRIVIAL(warning)
<< logPrefix_ << "Radial " << radial << " has different word size";
logger_->warn("Radial {} has different word size", radial);
continue;
}
@ -632,8 +632,7 @@ void Level2ProductView::ComputeSweep()
}
timer.stop();
BOOST_LOG_TRIVIAL(debug)
<< logPrefix_ << "Vertices calculated in " << timer.format(6, "%ws");
logger_->debug("Vertices calculated in {}", timer.format(6, "%ws"));
UpdateColorTable();

View file

@ -6,7 +6,6 @@
#include <scwx/wsr88d/rpg/graphic_product_message.hpp>
#include <scwx/wsr88d/rpg/radial_data_packet.hpp>
#include <boost/log/trivial.hpp>
#include <boost/range/irange.hpp>
#include <boost/timer/timer.hpp>
@ -17,7 +16,7 @@ namespace qt
namespace view
{
static const std::string logPrefix_ = "[scwx::qt::view::level3_product_view] ";
static const std::string logPrefix_ = "scwx::qt::view::level3_product_view";
static constexpr uint16_t RANGE_FOLDED = 1u;

View file

@ -1,11 +1,11 @@
#include <scwx/qt/view/level3_radial_view.hpp>
#include <scwx/common/constants.hpp>
#include <scwx/util/logger.hpp>
#include <scwx/util/threads.hpp>
#include <scwx/util/time.hpp>
#include <scwx/wsr88d/rpg/digital_radial_data_array_packet.hpp>
#include <scwx/wsr88d/rpg/radial_data_packet.hpp>
#include <boost/log/trivial.hpp>
#include <boost/range/irange.hpp>
#include <boost/timer/timer.hpp>
@ -16,7 +16,8 @@ namespace qt
namespace view
{
static const std::string logPrefix_ = "[scwx::qt::view::level3_radial_view] ";
static const std::string logPrefix_ = "scwx::qt::view::level3_radial_view";
static const auto logger_ = scwx::util::Logger::Create(logPrefix_);
static constexpr uint16_t RANGE_FOLDED = 1u;
static constexpr uint32_t VERTICES_PER_BIN = 6u;
@ -105,7 +106,7 @@ void Level3RadialView::SelectTime(std::chrono::system_clock::time_point time)
void Level3RadialView::ComputeSweep()
{
BOOST_LOG_TRIVIAL(debug) << logPrefix_ << "ComputeSweep()";
logger_->debug("ComputeSweep()");
boost::timer::cpu_timer timer;
@ -120,8 +121,7 @@ void Level3RadialView::ComputeSweep()
std::dynamic_pointer_cast<wsr88d::rpg::GraphicProductMessage>(message);
if (gpm == nullptr)
{
BOOST_LOG_TRIVIAL(warning)
<< logPrefix_ << "Graphic Product Message not found";
logger_->warn("Graphic Product Message not found");
return;
}
else if (gpm == graphic_product_message())
@ -139,7 +139,7 @@ void Level3RadialView::ComputeSweep()
gpm->symbology_block();
if (descriptionBlock == nullptr || symbologyBlock == nullptr)
{
BOOST_LOG_TRIVIAL(warning) << logPrefix_ << "Missing blocks";
logger_->warn("Missing blocks");
return;
}
@ -147,8 +147,7 @@ void Level3RadialView::ComputeSweep()
uint16_t numberOfLayers = symbologyBlock->number_of_layers();
if (numberOfLayers < 1)
{
BOOST_LOG_TRIVIAL(warning)
<< logPrefix_ << "No layers present in symbology block";
logger_->warn("No layers present in symbology block");
return;
}
@ -199,7 +198,7 @@ void Level3RadialView::ComputeSweep()
}
else
{
BOOST_LOG_TRIVIAL(debug) << logPrefix_ << "No radial data found";
logger_->debug("No radial data found");
return;
}
@ -207,8 +206,7 @@ void Level3RadialView::ComputeSweep()
const size_t radials = radialData->number_of_radials();
if (radials != 360 && radials != 720)
{
BOOST_LOG_TRIVIAL(warning)
<< logPrefix_ << "Unsupported number of radials: " << radials;
logger_->warn("Unsupported number of radials: {}", radials);
return;
}
@ -223,8 +221,7 @@ void Level3RadialView::ComputeSweep()
const uint16_t gates = radialData->number_of_range_bins();
if (gates < 1)
{
BOOST_LOG_TRIVIAL(warning)
<< logPrefix_ << "No range bins in radial data";
logger_->warn("No range bins in radial data");
return;
}
@ -368,8 +365,7 @@ void Level3RadialView::ComputeSweep()
dataMoments8.shrink_to_fit();
timer.stop();
BOOST_LOG_TRIVIAL(debug)
<< logPrefix_ << "Vertices calculated in " << timer.format(6, "%ws");
logger_->debug("Vertices calculated in {}", timer.format(6, "%ws"));
UpdateColorTable();

View file

@ -1,10 +1,10 @@
#include <scwx/qt/view/level3_raster_view.hpp>
#include <scwx/common/constants.hpp>
#include <scwx/util/logger.hpp>
#include <scwx/util/threads.hpp>
#include <scwx/util/time.hpp>
#include <scwx/wsr88d/rpg/raster_data_packet.hpp>
#include <boost/log/trivial.hpp>
#include <boost/range/irange.hpp>
#include <boost/timer/timer.hpp>
#include <GeographicLib/Geodesic.hpp>
@ -16,7 +16,8 @@ namespace qt
namespace view
{
static const std::string logPrefix_ = "[scwx::qt::view::level3_raster_view] ";
static const std::string logPrefix_ = "scwx::qt::view::level3_raster_view";
static const auto logger_ = scwx::util::Logger::Create(logPrefix_);
static constexpr uint16_t RANGE_FOLDED = 1u;
static constexpr uint32_t VERTICES_PER_BIN = 6u;
@ -105,7 +106,7 @@ void Level3RasterView::SelectTime(std::chrono::system_clock::time_point time)
void Level3RasterView::ComputeSweep()
{
BOOST_LOG_TRIVIAL(debug) << logPrefix_ << "ComputeSweep()";
logger_->debug("ComputeSweep()");
boost::timer::cpu_timer timer;
@ -120,8 +121,7 @@ void Level3RasterView::ComputeSweep()
std::dynamic_pointer_cast<wsr88d::rpg::GraphicProductMessage>(message);
if (gpm == nullptr)
{
BOOST_LOG_TRIVIAL(warning)
<< logPrefix_ << "Graphic Product Message not found";
logger_->warn("Graphic Product Message not found");
return;
}
else if (gpm == graphic_product_message())
@ -139,7 +139,7 @@ void Level3RasterView::ComputeSweep()
gpm->symbology_block();
if (descriptionBlock == nullptr || symbologyBlock == nullptr)
{
BOOST_LOG_TRIVIAL(warning) << logPrefix_ << "Missing blocks";
logger_->warn("Missing blocks");
return;
}
@ -147,8 +147,7 @@ void Level3RasterView::ComputeSweep()
uint16_t numberOfLayers = symbologyBlock->number_of_layers();
if (numberOfLayers < 1)
{
BOOST_LOG_TRIVIAL(warning)
<< logPrefix_ << "No layers present in symbology block";
logger_->warn("No layers present in symbology block");
return;
}
@ -179,7 +178,7 @@ void Level3RasterView::ComputeSweep()
if (rasterData == nullptr)
{
BOOST_LOG_TRIVIAL(debug) << logPrefix_ << "No raster data found";
logger_->debug("No raster data found");
return;
}
@ -193,7 +192,7 @@ void Level3RasterView::ComputeSweep()
if (maxColumns == 0)
{
BOOST_LOG_TRIVIAL(debug) << logPrefix_ << "No raster bins found";
logger_->debug("No raster bins found");
return;
}
@ -256,8 +255,7 @@ void Level3RasterView::ComputeSweep()
});
timer.stop();
BOOST_LOG_TRIVIAL(debug)
<< logPrefix_ << "Coordinates calculated in " << timer.format(6, "%ws");
logger_->debug("Coordinates calculated in {}", timer.format(6, "%ws"));
// Calculate vertices
timer.start();
@ -332,8 +330,7 @@ void Level3RasterView::ComputeSweep()
dataMoments8.shrink_to_fit();
timer.stop();
BOOST_LOG_TRIVIAL(debug)
<< logPrefix_ << "Vertices calculated in " << timer.format(6, "%ws");
logger_->debug("Vertices calculated in {}", timer.format(6, "%ws"));
UpdateColorTable();

View file

@ -1,7 +1,7 @@
#include <scwx/qt/view/radar_product_view.hpp>
#include <scwx/common/constants.hpp>
#include <scwx/util/logger.hpp>
#include <boost/log/trivial.hpp>
#include <boost/range/irange.hpp>
#include <boost/timer/timer.hpp>
@ -12,7 +12,8 @@ namespace qt
namespace view
{
static const std::string logPrefix_ = "[scwx::qt::view::radar_product_view] ";
static const std::string logPrefix_ = "scwx::qt::view::radar_product_view";
static const auto logger_ = scwx::util::Logger::Create(logPrefix_);
static const std::vector<boost::gil::rgba8_pixel_t> DEFAULT_COLOR_TABLE = {
boost::gil::rgba8_pixel_t(0, 128, 0, 255),
@ -102,7 +103,7 @@ RadarProductView::GetCfpMomentData() const
void RadarProductView::ComputeSweep()
{
BOOST_LOG_TRIVIAL(debug) << logPrefix_ << "ComputeSweep()";
logger_->debug("ComputeSweep()");
emit SweepComputed();
}

View file

@ -2,11 +2,10 @@
#include <scwx/qt/view/level2_product_view.hpp>
#include <scwx/qt/view/level3_radial_view.hpp>
#include <scwx/qt/view/level3_raster_view.hpp>
#include <scwx/util/logger.hpp>
#include <unordered_set>
#include <boost/log/trivial.hpp>
namespace scwx
{
namespace qt
@ -15,7 +14,8 @@ namespace view
{
static const std::string logPrefix_ =
"[scwx::qt::view::radar_product_view_factory] ";
"scwx::qt::view::radar_product_view_factory";
static const auto logger_ = scwx::util::Logger::Create(logPrefix_);
typedef std::function<std::shared_ptr<RadarProductView>(
const std::string& productName,
@ -46,8 +46,7 @@ std::shared_ptr<RadarProductView> RadarProductViewFactory::Create(
if (product == common::Level2Product::Unknown)
{
BOOST_LOG_TRIVIAL(warning)
<< logPrefix_ << "Unknown Level 2 radar product: " << productName;
logger_->warn("Unknown Level 2 radar product: {}", productName);
}
else
{
@ -67,9 +66,8 @@ std::shared_ptr<RadarProductView> RadarProductViewFactory::Create(
}
else
{
BOOST_LOG_TRIVIAL(warning)
<< logPrefix_ << "Unknown radar product group: "
<< common::GetRadarProductGroupName(productGroup);
logger_->warn("Unknown radar product group: {}",
common::GetRadarProductGroupName(productGroup));
}
return view;