diff options
author | David Winter <david.winter@analog.com> | 2021-09-28 13:42:54 +0200 |
---|---|---|
committer | mormj <34754695+mormj@users.noreply.github.com> | 2021-10-21 10:59:16 -0400 |
commit | db01027fd99c882cf8b3a7dad854606499778e3b (patch) | |
tree | 2b2acc3584dc36668ef3fb2493598e7abf7abd3c /gr-digital/lib | |
parent | 61709059f2e40a04ada73785812f19a5fc89cb8a (diff) |
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/lib')
-rw-r--r-- | gr-digital/lib/constellation_receiver_cb_impl.cc | 18 | ||||
-rw-r--r-- | gr-digital/lib/fll_band_edge_cc_impl.cc | 24 |
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 7dfa702c87..f11de55181 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 3d69ce9d88..d974d9e500 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, |