aboutsummaryrefslogtreecommitdiffstats
path: root/gr-digital
diff options
context:
space:
mode:
authorDavid Winter <david.winter@analog.com>2021-09-28 13:42:54 +0200
committermormj <34754695+mormj@users.noreply.github.com>2021-10-21 10:59:16 -0400
commitdb01027fd99c882cf8b3a7dad854606499778e3b (patch)
tree2b2acc3584dc36668ef3fb2493598e7abf7abd3c /gr-digital
parentpmt: Use VOLK allocator for PMT vectors (diff)
downloadgnuradio-db01027fd99c882cf8b3a7dad854606499778e3b.tar.xz
gnuradio-db01027fd99c882cf8b3a7dad854606499778e3b.zip
global: Replace stdio logging with logger
This commit replaces many uses of std::c{out,err} and printf with the appropriate GR_LOG_* directives. Signed-off-by: David Winter <david.winter@analog.com>
Diffstat (limited to 'gr-digital')
-rw-r--r--gr-digital/lib/constellation_receiver_cb_impl.cc18
-rw-r--r--gr-digital/lib/fll_band_edge_cc_impl.cc24
2 files changed, 22 insertions, 20 deletions
diff --git a/gr-digital/lib/constellation_receiver_cb_impl.cc b/gr-digital/lib/constellation_receiver_cb_impl.cc
index 7dfa702c8..f11de5518 100644
--- a/gr-digital/lib/constellation_receiver_cb_impl.cc
+++ b/gr-digital/lib/constellation_receiver_cb_impl.cc
@@ -18,6 +18,9 @@
#include <gnuradio/expj.h>
#include <gnuradio/io_signature.h>
#include <gnuradio/math.h>
+
+#include <boost/format.hpp>
+
#include <stdexcept>
namespace gr {
@@ -68,15 +71,12 @@ void constellation_receiver_cb_impl::phase_error_tracking(float phase_error)
frequency_limit();
#if VERBOSE_COSTAS
- printf("cl: phase_error: %f phase: %f freq: %f sample: %f+j%f constellation: "
- "%f+j%f\n",
- phase_error,
- d_phase,
- d_freq,
- sample.real(),
- sample.imag(),
- d_constellation->points()[d_current_const_point].real(),
- d_constellation->points()[d_current_const_point].imag());
+ GR_LOG_DEBUG(d_debug_logger,
+ boost::format("cl: phase_error: %f phase: %f freq: %f sample: %f+j%f "
+ " constellation: %f+j%f") %
+ phase_error % d_phase % d_freq % sample.real() % sample.imag() %
+ d_constellation->points()[d_current_const_point].real() %
+ d_constellation->points()[d_current_const_point].imag());
#endif
}
diff --git a/gr-digital/lib/fll_band_edge_cc_impl.cc b/gr-digital/lib/fll_band_edge_cc_impl.cc
index 3d69ce9d8..d974d9e50 100644
--- a/gr-digital/lib/fll_band_edge_cc_impl.cc
+++ b/gr-digital/lib/fll_band_edge_cc_impl.cc
@@ -17,6 +17,7 @@
#include <gnuradio/io_signature.h>
#include <cstdio>
#include <memory>
+#include <sstream>
namespace gr {
namespace digital {
@@ -171,17 +172,18 @@ void fll_band_edge_cc_impl::design_filter(float samps_per_sym,
void fll_band_edge_cc_impl::print_taps()
{
- printf("Upper Band-edge: [");
- for (const auto& tap : d_taps_upper) {
- printf(" %.4e + %.4ej,", tap.real(), tap.imag());
- }
- printf("]\n\n");
-
- printf("Lower Band-edge: [");
- for (const auto& tap : d_taps_lower) {
- printf(" %.4e + %.4ej,", tap.real(), tap.imag());
- }
- printf("]\n\n");
+ std::stringstream ss;
+ ss << "Upper Band-edge: [";
+ for (const auto& tap : d_taps_upper)
+ ss << boost::format(" %.4e + %.4ej,") % tap.real() % tap.imag();
+ ss << "]\n\n";
+
+ ss << "Lower Band-edge: [";
+ for (const auto& tap : d_taps_lower)
+ ss << boost::format(" %.4e + %.4ej,") % tap.real() % tap.imag();
+ ss << "]\n";
+
+ GR_LOG_INFO(d_logger, ss.str());
}
int fll_band_edge_cc_impl::work(int noutput_items,