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:
parent
b53b54d159
commit
6ed3757404
|
@ -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(','))
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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]
|
||||
|
|
Loading…
Reference in New Issue