Skip to content

Commit 50e1b40

Browse files
committed
[Debug] Add timestamp logging for SendSize and ReceiveSize functions
1 parent dd5953f commit 50e1b40

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

co_sim_io/sources/communication/base_socket_communication.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,9 @@ void BaseSocketCommunication<TSocketType>::SendSize(const std::uint64_t Size)
169169
CO_SIM_IO_TRY
170170

171171
DebugTimeInfo("SendSize", "Before send");
172+
#ifdef CO_SIM_IO_TIMESTAMP_DEBUG
173+
CO_SIM_IO_INFO("CoSimIO::SendSize") << Size << std::endl;
174+
#endif
172175

173176
asio::write(*mpAsioSocket, asio::buffer(&Size, sizeof(Size)));
174177

@@ -188,14 +191,20 @@ std::uint64_t BaseSocketCommunication<TSocketType>::ReceiveSize()
188191
asio::read(*mpAsioSocket, asio::buffer(&imp_size_u, sizeof(imp_size_u)));
189192

190193
DebugTimeInfo("ReceiveSize", "After receive");
194+
#ifdef CO_SIM_IO_TIMESTAMP_DEBUG
195+
CO_SIM_IO_INFO("CoSimIO::ReceiveSize") << imp_size_u << std::endl;
196+
#endif
191197

192198
return imp_size_u;
193199

194200
CO_SIM_IO_CATCH
195201
}
196202

197203
template<class TSocketType>
198-
void BaseSocketCommunication<TSocketType>::DebugTimeInfo(const std::string& rLabel, const std::string& rMessage) const
204+
void BaseSocketCommunication<TSocketType>::DebugTimeInfo(
205+
const std::string& rLabel,
206+
const std::string& rMessage
207+
) const
199208
{
200209
#ifdef CO_SIM_IO_TIMESTAMP_DEBUG
201210
// Get the current time

0 commit comments

Comments
 (0)