Skip to content

Commit b2cf8bf

Browse files
committed
Removed some debug
Removed debug to avoid writing to stdout
1 parent 3670acf commit b2cf8bf

File tree

1 file changed

+3
-17
lines changed

1 file changed

+3
-17
lines changed

DataDogStatsD.cpp

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,6 @@ void DataDogStatsD::send(std::map<string, string> data, float sampleRate, string
249249
void DataDogStatsD::flush(string& udp_message)
250250
{
251251
#ifndef _WIN32
252-
cout << "Sending " << udp_message << endl;
253252

254253
int udp_socket = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
255254
/*struct sockaddr_in sin;
@@ -271,23 +270,10 @@ void DataDogStatsD::flush(string& udp_message)
271270
cout << "Failed to bind UDP port" << endl;
272271
}*/
273272

274-
int connect_result = connect(udp_socket, (struct sockaddr *) &serv_addr, sizeof(serv_addr));
275-
if (connect_result < 0)
276-
{
277-
cout << "Failed to connect" << endl;
278-
cout << "Error: " << strerror(connect_result) << endl;
279-
}
273+
connect(udp_socket, (struct sockaddr *) &serv_addr, sizeof(serv_addr));
280274

281-
int sentBytes = write(udp_socket, udp_message.c_str(), udp_message.length());
282-
if (sentBytes >= 0)
283-
{
284-
cout << "Sent " << sentBytes << "bytes" << endl;
285-
}
286-
else
287-
{
288-
cout << "Failed to send data" << endl;
289-
cout << "Error: " << strerror(sentBytes) << endl;
290-
}
275+
write(udp_socket, udp_message.c_str(), udp_message.length());
276+
291277

292278
close(udp_socket);
293279
#else

0 commit comments

Comments
 (0)