Skip to content

Commit

Permalink
[log] Simplify trace messages (now that it partially works...)
Browse files Browse the repository at this point in the history
  • Loading branch information
thoni56 committed Mar 6, 2023
1 parent e05545b commit fa7e666
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
6 changes: 2 additions & 4 deletions src/client_handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,16 @@ ResultCode handle_client_request(FILE *server_request_channel, FILE *client_requ

if (id != NULL) {
// A request
log_trace("client -> : '%s' request (%d)", method->valuestring, id->valueint);
log_trace("client -> server : '%s' request (%d)", method->valuestring, id->valueint);
int result = jsonSend(root, server_request_channel);
log_trace("-> server : '%s' request (%d)", method->valuestring, id->valueint);
if (result == EOF)
rc = RC_ERROR_SENDING_TO_SERVER;
if (strcmp(method->valuestring, "exit") == 0)
rc = RC_EXIT;
} else {
// A notification
log_trace("client -> : '%s' notification", method->valuestring);
log_trace("client -> server : '%s' notification", method->valuestring);
int result = jsonSend(root, server_request_channel);
log_trace("-> server : '%s' notification", method->valuestring);
if (result == EOF)
rc = RC_ERROR_SENDING_TO_SERVER;
}
Expand Down
3 changes: 1 addition & 2 deletions src/server_handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,8 @@ ResultCode handle_server_response(FILE *server_response_channel, FILE *client_re
cJSON *id = jsonGetObjectItem(root, "id");
cJSON *result = jsonGetObjectItem(root, "result");
if (result != NULL) {
log_trace("<- server : result (%d)", id->valueint);
log_trace("client <- server : result (%d)", id->valueint);
int result = jsonSend(root, client_response_channel);
log_trace("client <- : result (%d)", id->valueint);
if (result == EOF)
rc = RC_ERROR_SENDING_TO_CLIENT;
jsonDelete(root);
Expand Down

0 comments on commit fa7e666

Please sign in to comment.