lib/fozzie/socket.rb in fozzie-0.0.20 vs lib/fozzie/socket.rb in fozzie-0.0.21

- old
+ new

@@ -31,11 +31,12 @@ # Send data to the server via the socket def send_to_socket(message) begin Fozzie.logger.debug {"Statsd: #{message}"} if Fozzie.logger Timeout.timeout(Fozzie.c.timeout) { - socket.send(message, 0, Fozzie.c.host, Fozzie.c.port) - true + res = socket.send(message, 0, Fozzie.c.host, Fozzie.c.port) + Fozzie.logger.debug {"Statsd sent: #{res}"} if Fozzie.logger + (res.to_i == message.length) } rescue => exc Fozzie.logger.debug {"Statsd Failure: #{exc.message}\n#{exc.backtrace}"} if Fozzie.logger false end \ No newline at end of file