[ 
https://issues.apache.org/jira/browse/GEODE-9214?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17339066#comment-17339066
 ] 

ASF GitHub Bot commented on GEODE-9214:
---------------------------------------

gaussianrecurrence commented on a change in pull request #797:
URL: https://github.com/apache/geode-native/pull/797#discussion_r625865822



##########
File path: cppcache/integration-test/fw_dunit.cpp
##########
@@ -688,36 +680,63 @@ void sleep(int millis) {
 }
 
 void logCoordinator(std::string s, int lineno, const char * /*filename*/) {
-  char buf[128] = {0};
-  dunit::getTimeStr(buf, sizeof(buf));
-
-  fprintf(stdout, "[TEST coordinator:pid(%d)] %s at line: %d\n",
-          boost::this_process::get_id(), s.c_str(), lineno);
-  fflush(stdout);
+  using std::chrono::duration_cast;
+  using std::chrono::microseconds;
+  using std::chrono::system_clock;
+
+  auto now = system_clock::now();
+  auto in_time_t = system_clock::to_time_t(now);
+  auto localtime = std::localtime(&in_time_t);
+  auto usec =
+      duration_cast<microseconds>(now.time_since_epoch()).count() % 1000;
+
+  std::cout << "[TEST " << std::put_time(localtime, "%Y/%m/%d %H:%M:%S") << '.'
+            << std::setfill('0') << std::setw(6) << usec << std::setw(0)
+            << " coordinator:pid(" << boost::this_process::get_id() << ")] "
+            << s << " at line: " << lineno << std::endl
+            << std::flush;
 }
 
 // log a message and print the worker id as well.. used by fw_helper with no
 // worker id.
 void log(std::string s, int lineno, const char * /*filename*/, int /*id*/) {
-  char buf[128] = {0};
-  dunit::getTimeStr(buf, sizeof(buf));
-
-  fprintf(stdout, "[TEST 0:pid(%d)] %s at line: %d\n",
-          boost::this_process::get_id(), s.c_str(), lineno);
-  fflush(stdout);
+  using std::chrono::duration_cast;

Review comment:
       Sadly I only changed tests/cpp/security code to log with Boost.Log
   Thing is in theory this PR is supposed to be focused remove references for 
ACE time library.
   Also, I tried to replace logging for Boost.Log on the old ITs, and the 
changes were huge.
   So what do you think if a open a separate PR to adress this?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Remove ACE time library references
> ----------------------------------
>
>                 Key: GEODE-9214
>                 URL: https://issues.apache.org/jira/browse/GEODE-9214
>             Project: Geode
>          Issue Type: Improvement
>          Components: native client
>            Reporter: Mario Salazar de Torres
>            Assignee: Mario Salazar de Torres
>            Priority: Major
>              Labels: obliterate-ace, pull-request-available
>
> *AS A* geode-native contributor
> *I WANT TO* remove all references to ACE time library
> *SO THAT* we can advance in the effort to completly remove ACE library from 
> the native client



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to