Replace LOG.warn with LOG.warning

logging.warn is deprecated in Python 3.[1]
[1] https://docs.python.org/3/library/logging.html#logging.warning

Change-Id: I0804f1dad51007e969c48c8cd4a338d002391f9e
This commit is contained in:
gecong1973 2016-11-17 09:19:04 +08:00 committed by gecong
parent b53b54d159
commit 6ed3757404
3 changed files with 7 additions and 7 deletions

View File

@ -143,7 +143,7 @@ class RoleMiddleware(om.ConfigurableMiddleware):
roles = headers.get(_X_ROLES)
if not roles:
LOG.warn('Couldn\'t locate %s header, or it was empty', _X_ROLES)
LOG.warning('Couldn\'t locate %s header,or it was empty', _X_ROLES)
return False, False
else:
roles = _ensure_lower_roles(roles.split(','))

View File

@ -85,8 +85,8 @@ def get_client(dimensions=None):
if key not in _DEFAULT_DIMENSIONS:
dims[key] = val
else:
LOG.warn('Cannot override fixed dimension %s=%s', key,
_DEFAULT_DIMENSIONS[key])
LOG.warning('Cannot override fixed dimension %s=%s', key,
_DEFAULT_DIMENSIONS[key])
connection = monascastatsd.Connection(
host=CONF.monitoring.statsd_host,

View File

@ -195,10 +195,10 @@ class LogPublisher(object):
if diff_size > 1:
truncated_by = diff_size + _TRUNCATED_PROPERTY_SIZE
LOG.warn(('Detected message that exceeds %d bytes,'
'message will be truncated by %d bytes'),
self.max_message_size,
truncated_by)
LOG.warning(('Detected message that exceeds %d bytes,'
'message will be truncated by %d bytes'),
self.max_message_size,
truncated_by)
log_msg = envelope['log']['message']
truncated_log_msg = log_msg[:-truncated_by]