From d0b9cda9f2bed44dd267ebee03ab03cb6f6b89ba Mon Sep 17 00:00:00 2001 From: "John M. Penn" Date: Mon, 26 Jun 2017 17:50:54 -0500 Subject: [PATCH] Fixed variable server debug messages. Ref #447 --- .../VariableServer/VariableServerThread_commands.cpp | 6 ++---- .../VariableServer/VariableServerThread_write_data.cpp | 10 ++++------ 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/trick_source/sim_services/VariableServer/VariableServerThread_commands.cpp b/trick_source/sim_services/VariableServer/VariableServerThread_commands.cpp index 4c04c733..b2dfe0f1 100644 --- a/trick_source/sim_services/VariableServer/VariableServerThread_commands.cpp +++ b/trick_source/sim_services/VariableServer/VariableServerThread_commands.cpp @@ -200,8 +200,7 @@ int Trick::VariableServerThread::var_exists(std::string in_name) { /* send ascii "1" or "0" */ sprintf(buf1, "%d\t%d\n", VS_VAR_EXISTS, (error==false)); if (debug >= 2) { - message_publish(MSG_DEBUG, "%p tag=<%s> var_server sending:", &connection, connection.client_tag) ; - message_publish(MSG_NORMAL, "%s\n", buf1); + message_publish(MSG_DEBUG, "%p tag=<%s> var_server sending:\n%s\n", &connection, connection.client_tag, buf1) ; } tc_write(&connection, (char *) buf1, strlen(buf1)); } @@ -394,8 +393,7 @@ int Trick::VariableServerThread::send_list_size() { // ascii sprintf(buf1, "%d\t%d\n", VS_LIST_SIZE, var_count); if (debug >= 2) { - message_publish(MSG_DEBUG, "%p tag=<%s> var_server sending number of event variables:", &connection, connection.client_tag) ; - message_publish(MSG_NORMAL, "%s\n", buf1); + message_publish(MSG_DEBUG, "%p tag=<%s> var_server sending number of event variables:\n%s\n", &connection, connection.client_tag, buf1) ; } tc_write(&connection, (char *) buf1, strlen(buf1)); } diff --git a/trick_source/sim_services/VariableServer/VariableServerThread_write_data.cpp b/trick_source/sim_services/VariableServer/VariableServerThread_write_data.cpp index 6ebf9726..57717271 100644 --- a/trick_source/sim_services/VariableServer/VariableServerThread_write_data.cpp +++ b/trick_source/sim_services/VariableServer/VariableServerThread_write_data.cpp @@ -244,9 +244,8 @@ int Trick::VariableServerThread::write_data() { if( len + strlen( val ) + 2 > MAX_MSG_LEN ) { if (debug >= 2) { - message_publish(MSG_DEBUG, "%p tag=<%s> var_server sending %d ascii bytes:", - &connection, connection.client_tag, (int)strlen(buf1)) ; - message_publish(MSG_NORMAL, "%s\n", buf1); + message_publish(MSG_DEBUG, "%p tag=<%s> var_server sending %d ascii bytes:\n%s\n", + &connection, connection.client_tag, (int)strlen(buf1), buf1) ; } ret = tc_write(&connection, (char *) buf1, len); @@ -266,9 +265,8 @@ int Trick::VariableServerThread::write_data() { buf1[ strlen(buf1) - 1 ] = '\n'; if (debug >= 2) { - message_publish(MSG_DEBUG, "%p tag=<%s> var_server sending %d ascii bytes:", - &connection, connection.client_tag, (int)strlen(buf1)) ; - message_publish(MSG_NORMAL, "%s\n", buf1); + message_publish(MSG_DEBUG, "%p tag=<%s> var_server sending %d ascii bytes:\n%s\n", + &connection, connection.client_tag, (int)strlen(buf1), buf1) ; } ret = tc_write(&connection, (char *) buf1, (int)strlen(buf1)); if ( ret != (int)strlen(buf1) ) {