No reason to start with '_' define a general variable

Just make code consistency,we usually use LOG to logging message rather than _LOG.
Also starting with '_' define a general variable make confused.

Change-Id: I47656e33cbc19774a0780e5b0034df0897f6afad
This commit is contained in:
xiaozhuangqing 2016-09-27 12:58:44 +08:00 committed by Mehdi Abaakouk (sileht)
parent 9d4c26e73f
commit 26bfc4859e
1 changed files with 9 additions and 9 deletions

View File

@ -61,7 +61,7 @@ import six.moves.queue as queue
import six.moves.urllib.parse as urlparse
import threading
_LOG = logging.getLogger(__name__)
LOG = logging.getLogger(__name__)
def _log_and_ignore_error(fn):
@ -70,8 +70,8 @@ def _log_and_ignore_error(fn):
try:
return fn(*args, **kwargs)
except Exception as e:
_LOG.exception('An exception occurred processing '
'the API call: %s ', e)
LOG.exception('An exception occurred processing '
'the API call: %s ', e)
return wrapper
@ -134,7 +134,7 @@ class Swift(object):
if self.reseller_prefix and self.reseller_prefix[-1] != '_':
self.reseller_prefix += '_'
_LOG.setLevel(getattr(logging, conf.get('log_level', 'WARNING')))
LOG.setLevel(getattr(logging, conf.get('log_level', 'WARNING')))
# NOTE: If the background thread's send queue fills up, the event will
# be discarded
@ -284,7 +284,7 @@ class Swift(object):
Swift.threadLock.release()
except queue.Full:
_LOG.warning('Send queue FULL: Event %s not added', event.id)
LOG.warning('Send queue FULL: Event %s not added', event.id)
else:
Swift.send_notification(self._notifier, event)
@ -308,13 +308,13 @@ class SendEventThread(threading.Thread):
"""Send events without blocking swift proxy."""
while True:
try:
_LOG.debug('Wait for event from send queue')
LOG.debug('Wait for event from send queue')
event = Swift.event_queue.get()
_LOG.debug('Got event %s from queue - now send it', event.id)
LOG.debug('Got event %s from queue - now send it', event.id)
Swift.send_notification(self.notifier, event)
_LOG.debug('Event %s sent.', event.id)
LOG.debug('Event %s sent.', event.id)
except BaseException:
_LOG.exception("SendEventThread loop exception")
LOG.exception("SendEventThread loop exception")
def filter_factory(global_conf, **local_conf):