summaryrefslogtreecommitdiff
path: root/gr-blocks/lib/check_lfsr_32k_s_impl.cc
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-blocks/lib/check_lfsr_32k_s_impl.cc
parent61709059f2e40a04ada73785812f19a5fc89cb8a (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-blocks/lib/check_lfsr_32k_s_impl.cc')
-rw-r--r--gr-blocks/lib/check_lfsr_32k_s_impl.cc38
1 files changed, 18 insertions, 20 deletions
diff --git a/gr-blocks/lib/check_lfsr_32k_s_impl.cc b/gr-blocks/lib/check_lfsr_32k_s_impl.cc
index 443b01ce70..48c8493d97 100644
--- a/gr-blocks/lib/check_lfsr_32k_s_impl.cc
+++ b/gr-blocks/lib/check_lfsr_32k_s_impl.cc
@@ -17,6 +17,8 @@
#include <cstdio>
#include <cstdlib>
+static constexpr bool CHECK_LFSR_DEBUG = false;
+
namespace gr {
namespace blocks {
@@ -112,11 +114,11 @@ void check_lfsr_32k_s_impl::enter_SEARCHING()
d_runlength = 0;
d_index = 0; // reset LFSR to beginning
- if (0)
- fprintf(stdout,
- "check_lfsr_32k: enter_SEARCHING at offset %8ld (0x%08lx)\n",
- d_ntotal,
- d_ntotal);
+ if (CHECK_LFSR_DEBUG)
+ GR_LOG_DEBUG(
+ d_debug_logger,
+ boost::format("check_lfsr_32k: enter_SEARCHING at offset %8ld (0x%08lx)") %
+ d_ntotal % d_ntotal);
enter_MATCH0();
}
@@ -136,25 +138,21 @@ void check_lfsr_32k_s_impl::enter_LOCKED()
d_index = 3; // already matched first 3 items
- if (0)
- fprintf(stdout,
- "check_lfsr_32k: enter_LOCKED at offset %8ld (0x%08lx)\n",
- d_ntotal,
- d_ntotal);
+ if (CHECK_LFSR_DEBUG)
+ GR_LOG_DEBUG(
+ d_debug_logger,
+ boost::format("check_lfsr_32k: enter_LOCKED at offset %8ld (0x%08lx)") %
+ d_ntotal % d_ntotal);
}
void check_lfsr_32k_s_impl::log_error(unsigned short expected, unsigned short actual)
{
- if (0)
- fprintf(stdout,
- "check_lfsr_32k: expected %5d (0x%04x) got %5d (0x%04x) offset %8ld "
- "(0x%08lx)\n",
- expected,
- expected,
- actual,
- actual,
- d_ntotal,
- d_ntotal);
+ if (CHECK_LFSR_DEBUG)
+ GR_LOG_DEBUG(
+ d_debug_logger,
+ boost::format("check_lfsr_32k: expected %5d (0x%04x) got %5d (0x%04x) "
+ "offset %8ld (0x%08lx)") %
+ expected % expected % actual % actual % d_ntotal % d_ntotal);
}
} /* namespace blocks */