64 const std::string & message )
67 using namespace chrono;
69 ostringstream total_message;
71 auto now = system_clock::now();
72 auto ms = duration_cast< milliseconds >( now.time_since_epoch() );
73 time_t unix_time = duration_cast< seconds >( ms ).count();
75 char date_time_first_part[ 64 ];
76 strftime( date_time_first_part,
sizeof( date_time_first_part ) - 1,
77 "%Y-%m-%d %H:%M:%S", localtime( &unix_time ) );
78 char date_time_second_part[ 16 ];
79 sprintf( date_time_second_part,
".%03u",
80 static_cast<
unsigned int >( ms.count() % 1000u ) );
82 total_message <<
"[" << date_time_first_part
83 << date_time_second_part
84 <<
" TID:" << query_current_thread_id()
86 <<
" (" << file <<
":" << line
89 cerr << total_message.str();