Skip to content

Commit

Permalink
avoid Debug messages when not wanted
Browse files Browse the repository at this point in the history
  • Loading branch information
kosloot committed Feb 21, 2023
1 parent 99eaf79 commit 3bb2923
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/FrogAPI.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1645,6 +1645,9 @@ void FrogAPI::FrogServer( Sockets::ClientSocket &conn ){
}
if ( json_line.empty() ){
// assume we are done
if ( options.debugFlag > 5 ){
DBG << "Done with processing JSON. exit" << endl;
}
LOG << "Done with JSON" << endl;
return; // closes this connection
}
Expand All @@ -1657,7 +1660,9 @@ void FrogAPI::FrogServer( Sockets::ClientSocket &conn ){
<< e.what() << endl;
throw runtime_error( "json failure" );
}
DBG << "Read JSON: " << the_json << endl;
if ( options.debugFlag ){
DBG << "Parsed JSON: " << the_json << endl;
}
for ( const auto& it : the_json ){
string data = it["sentence"];
timers.tokTimer.stop();
Expand Down Expand Up @@ -2315,7 +2320,9 @@ void FrogAPI::output_JSON( ostream& os,
out_json.push_back( part );
}
}
DBG << "spitting out JSON:" << out_json << endl;
if ( options.debugFlag ){
DBG << "spitting out JSON:" << out_json << endl;
}
os << std::setw(pp_val) << out_json << endl;
}

Expand Down

0 comments on commit 3bb2923

Please sign in to comment.