Use logging's built-in string interpolation
This commit is contained in:
@@ -247,12 +247,12 @@ class BrokerConnection(object):
|
||||
socket.AF_UNSPEC,
|
||||
socket.SOCK_STREAM)
|
||||
except socket.gaierror as ex:
|
||||
log.warning('DNS lookup failed for {0}:{1},'
|
||||
' exception was {2}. Is your'
|
||||
log.warning('DNS lookup failed for %s:%d,'
|
||||
' exception was %s. Is your'
|
||||
' advertised.listeners (called'
|
||||
' advertised.host.name before Kafka 9)'
|
||||
' correct and resolvable?'.format(
|
||||
self._init_host, self._init_port, ex))
|
||||
' correct and resolvable?',
|
||||
self._init_host, self._init_port, ex)
|
||||
self._gai = []
|
||||
self._gai_index = 0
|
||||
else:
|
||||
|
@@ -217,8 +217,7 @@ def _send_upstream(queue, client, codec, batch_time, batch_size,
|
||||
else hash(orig_req.messages))
|
||||
|
||||
if request_tries or not queue.empty():
|
||||
log.error('Stopped producer with {0} unsent messages'
|
||||
.format(len(request_tries) + queue.qsize()))
|
||||
log.error('Stopped producer with %d unsent messages', len(request_tries) + queue.qsize())
|
||||
|
||||
|
||||
class Producer(object):
|
||||
|
Reference in New Issue
Block a user