Move logging out of try catch

This commit is contained in:
Dan g 2018-07-18 11:43:25 -04:00
parent 0fc46f82b4
commit 7b7010b0a2

View file

@ -163,9 +163,10 @@ class StatsDCollector(object):
msg = '{0}:{1}|{2}'.format(
self._build_path(path, metric_type), value, metric_type)
LOGGER.debug('Sending %s to %s:%s', msg.encode('ascii'),
self._host, self._port)
try:
LOGGER.debug('Sending %s to %s:%s', msg.encode('ascii'),
self._host, self._port)
if self._tcp:
return self._sock.write(msg.encode('ascii'))