Fix output going to the wrong stream. ref #678

This commit is contained in:
Penn, John M 047828115 2019-03-07 10:43:40 -06:00
parent 7ef86c92c0
commit 531a94173e

View File

@ -21,7 +21,7 @@ Trick::VariableServer::~VariableServer() {
std::ostream& Trick::operator<< (std::ostream& s, Trick::VariableServer& vs) {
std::map < pthread_t , VariableServerThread * >::iterator it ;
std::cout << "{\"variable-server-connections\":[" << std::endl;
s << "{\"variable_server_connections\":[" << std::endl;
int count = 0;
int n_connections = (int)vs.var_server_threads.size();
for ( it = vs.var_server_threads.begin() ; it != vs.var_server_threads.end() ; it++ ) {
@ -29,7 +29,7 @@ std::ostream& Trick::operator<< (std::ostream& s, Trick::VariableServer& vs) {
s << *(*it).second;
s << "}";
if ((n_connections-count)>1) {
std::cout << "," ;
s << "," ;
}
s << std::endl;
count ++;