Skip to content

Commit

Permalink
Per #2724, update sdebug_examine() and debug_examine() functions to r…
Browse files Browse the repository at this point in the history
…efine their log messages
  • Loading branch information
JohnHalleyGotway committed Nov 6, 2023
1 parent 1085c85 commit aa80374
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/basic/vx_util/data_plane.cc
Original file line number Diff line number Diff line change
Expand Up @@ -262,21 +262,24 @@ void DataPlane::debug_examine(bool show_all_values) const {
}
}

mlog << Debug(4) << "Total count = " << total_count << "\n";
mlog << Debug(4) << "Total count > 0 = " << total_count
<< " of " << Data.size() << "\n";

return;
}

///////////////////////////////////////////////////////////////////////////////

string DataPlane::sdebug_examine() const{
ConcatString cs;
int total_count = 0;
int n = 0;

// Count positive values
for(int i=0; i<Data.size(); i++) {
if(Data[i] > 0) total_count++;
for(auto it = Data.begin(); it != Data.end(); it++) {
if(*it > 0) n++;
}

cs << "Total count = " << total_count;
cs << "Total count > 0 = " << n << " of " << (int) Data.size();

return cs;
}
Expand Down

0 comments on commit aa80374

Please sign in to comment.