Skip to content

Commit

Permalink
blocks: Address Issue #816.
Browse files Browse the repository at this point in the history
If any input stream has tags, set toprint to true. Use this as the way
to gate printing of sout.
  • Loading branch information
trondeau committed Jul 29, 2015
1 parent bc626fd commit bc82238
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion gr-blocks/lib/tag_debug_impl.cc
Expand Up @@ -98,6 +98,7 @@ namespace gr {
gr_vector_void_star &output_items)
{
gr::thread::scoped_lock l(d_mutex);
bool toprint = false;

std::stringstream sout;
if(d_display) {
Expand All @@ -117,6 +118,10 @@ namespace gr {
else
get_tags_in_range(d_tags, i, abs_N, end_N, d_filter);

if(d_tags.size() > 0) {
toprint = true;
}

if(d_display) {
sout << "Input Stream: " << std::setw(2) << std::setfill('0')
<< i << std::setfill(' ') << std::endl;
Expand All @@ -135,8 +140,9 @@ namespace gr {
sout << "----------------------------------------------------------------------";
sout << std::endl;

if(d_tags.size() > 0)
if(toprint) {
std::cout << sout.str();
}
}

return noutput_items;
Expand Down

0 comments on commit bc82238

Please sign in to comment.