From d0cb9790c0f6cc8b12de47192d8efdf7c020448d Mon Sep 17 00:00:00 2001 From: dan-du-car <62157949+dan-du-car@users.noreply.github.com> Date: Wed, 26 Apr 2023 12:10:00 -0400 Subject: [PATCH] Add more logs for analysis (#523) # PR Details ## Description Add more terminal logs to catch http request from v2xhub to cloud. The timestamp before the request and after successfully response from the cloud. ## Related Issue https://github.com/usdot-fhwa-OPS/V2X-Hub/issues/515 ## Motivation and Context ERV verification testing metrics ## How Has This Been Tested? NA ## Types of changes - [x] Defect fix (non-breaking change that fixes an issue) - [ ] New feature (non-breaking change that adds functionality) - [ ] Breaking change (fix or feature that cause existing functionality to change) ## Checklist: - [ ] I have added any new packages to the sonar-scanner.properties file - [ ] My change requires a change to the documentation. - [ ] I have updated the documentation accordingly. - [x] I have read the **CONTRIBUTING** document. [V2XHUB Contributing Guide](https://github.com/usdot-fhwa-OPS/V2X-Hub/blob/develop/Contributing.md) - [ ] I have added tests to cover my changes. - [ ] All new and existing tests passed. --- .../ERVCloudForwardingPlugin/src/ERVCloudForwardingPlugin.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/v2i-hub/ERVCloudForwardingPlugin/src/ERVCloudForwardingPlugin.cpp b/src/v2i-hub/ERVCloudForwardingPlugin/src/ERVCloudForwardingPlugin.cpp index 71bdca3c9..8a1d44037 100644 --- a/src/v2i-hub/ERVCloudForwardingPlugin/src/ERVCloudForwardingPlugin.cpp +++ b/src/v2i-hub/ERVCloudForwardingPlugin/src/ERVCloudForwardingPlugin.cpp @@ -196,13 +196,14 @@ namespace ERVCloudForwardingPlugin curl_easy_setopt(req, CURLOPT_POSTFIELDS, local_msg.c_str()); curl_easy_setopt(req, CURLOPT_TIMEOUT_MS, 5000L); //Http request timeout in 5 seconds curl_easy_setopt(req, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2); + PLOG(logDEBUG) << "Forwarding message to cloud via curl: " << local_msg << endl; res = curl_easy_perform(req); if (res != CURLE_OK) { fprintf(stderr, "curl send failed: %s\n", curl_easy_strerror(res)); return EXIT_FAILURE; }else{ - PLOG(logDEBUG) << "Successfully forward ERV BSM to cloud: " << local_msg << endl; + PLOG(logDEBUG) << "Successfully forwarded message to cloud via curl: " << local_msg << endl; } } curl_easy_cleanup(req);