Skip to content

Commit

Permalink
Avoid deprecation warning for log.warn
Browse files Browse the repository at this point in the history
  • Loading branch information
davisagli committed May 9, 2018
1 parent dd61b83 commit 08237d4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CHANGES.rst
Expand Up @@ -11,7 +11,7 @@ https://github.com/zopefoundation/Zope/blob/4.0a6/CHANGES.rst
4.0b5 (unreleased)
------------------

- Nothing changed yet.
- Use log.warning to avoid deprecation warning for log.warn


4.0b4 (2018-04-23)
Expand Down
9 changes: 5 additions & 4 deletions src/OFS/Application.py
Expand Up @@ -370,10 +370,11 @@ def import_products():
done = {}
for priority, product_name, index, product_dir in get_products():
if product_name in done:
LOG.warn('Duplicate Product name: '
'After loading Product %r from %r, '
'I skipped the one in %r.' % (
product_name, done[product_name], product_dir))
LOG.warning(
'Duplicate Product name: '
'After loading Product %r from %r, '
'I skipped the one in %r.' % (
product_name, done[product_name], product_dir))
continue
done[product_name] = product_dir
import_product(product_dir, product_name)
Expand Down
6 changes: 3 additions & 3 deletions src/OFS/Cache.py
Expand Up @@ -165,7 +165,7 @@ def ZCacheable_get(self, view_name='', keywords=None,
mtime_func, default)
return val
except:
LOG.warn('ZCache_get() exception')
LOG.warning('ZCache_get() exception')
return default
return default

Expand All @@ -182,7 +182,7 @@ def ZCacheable_set(self, data, view_name='', keywords=None,
c.ZCache_set(ob, data, view_name, keywords,
mtime_func)
except:
LOG.warn('ZCache_set() exception')
LOG.warning('ZCache_set() exception')

security.declareProtected(ViewManagementScreensPermission,
'ZCacheable_invalidate')
Expand All @@ -201,7 +201,7 @@ def ZCacheable_invalidate(self, view_name='', REQUEST=None):
except:
exc = sys.exc_info()
try:
LOG.warn('ZCache_invalidate() exception')
LOG.warning('ZCache_invalidate() exception')
message = 'An exception occurred: %s: %s' % exc[:2]
finally:
exc = None
Expand Down

0 comments on commit 08237d4

Please sign in to comment.