diff options
author | Tom Rondeau | 2012-12-13 13:45:35 -0500 |
---|---|---|
committer | Tom Rondeau | 2012-12-13 13:45:35 -0500 |
commit | 0ce94e0df4c20c2dfc3cbf98ef97aecc49ee1cd5 (patch) | |
tree | 1e42fc154885453c9bf80e355394379dda86c16f /gnuradio-core | |
parent | 01837095fe61ccb560e0db8ea7646bd068821d6c (diff) | |
download | gnuradio-0ce94e0df4c20c2dfc3cbf98ef97aecc49ee1cd5.tar.gz gnuradio-0ce94e0df4c20c2dfc3cbf98ef97aecc49ee1cd5.tar.bz2 gnuradio-0ce94e0df4c20c2dfc3cbf98ef97aecc49ee1cd5.zip |
core: better tag debugger. Only outputs when there are tags to show.
Diffstat (limited to 'gnuradio-core')
-rw-r--r-- | gnuradio-core/src/lib/general/gr_tag_debug.cc | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/gnuradio-core/src/lib/general/gr_tag_debug.cc b/gnuradio-core/src/lib/general/gr_tag_debug.cc index c4031f438..5833a1891 100644 --- a/gnuradio-core/src/lib/general/gr_tag_debug.cc +++ b/gnuradio-core/src/lib/general/gr_tag_debug.cc @@ -65,10 +65,11 @@ gr_tag_debug::work(int noutput_items, { gruel::scoped_lock l(d_mutex); + std::stringstream sout; if(d_display) { - std::cout << std::endl - << "----------------------------------------------------------------------"; - std::cout << std::endl << "Tag Debug: " << d_name << std::endl; + sout << std::endl + << "----------------------------------------------------------------------"; + sout << std::endl << "Tag Debug: " << d_name << std::endl; } uint64_t abs_N, end_N; @@ -80,20 +81,23 @@ gr_tag_debug::work(int noutput_items, get_tags_in_range(d_tags, i, abs_N, end_N); if(d_display) { - std::cout << "Input Stream: " << i << std::endl; + sout << "Input Stream: " << i << std::endl; for(d_tags_itr = d_tags.begin(); d_tags_itr != d_tags.end(); d_tags_itr++) { - std::cout << std::setw(10) << "Offset: " << d_tags_itr->offset - << std::setw(10) << "Source: " << pmt::pmt_symbol_to_string(d_tags_itr->srcid) - << std::setw(10) << "Key: " << pmt::pmt_symbol_to_string(d_tags_itr->key) - << std::setw(10) << "Value: "; - pmt::pmt_print(d_tags_itr->value); + sout << std::setw(10) << "Offset: " << d_tags_itr->offset + << std::setw(10) << "Source: " << pmt::pmt_symbol_to_string(d_tags_itr->srcid) + << std::setw(10) << "Key: " << pmt::pmt_symbol_to_string(d_tags_itr->key) + << std::setw(10) << "Value: "; + sout << d_tags_itr->value << std::endl; } } } if(d_display) { - std::cout << "----------------------------------------------------------------------"; - std::cout << std::endl; + sout << "----------------------------------------------------------------------"; + sout << std::endl; + + if(d_tags.size() > 0) + std::cout << sout.str(); } return noutput_items; |