Formatting anti-pattern in log messages leave % placeholders unresolved
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Shared File Systems Service (Manila) |
Fix Released
|
Low
|
Ramana Raja |
Bug Description
The following anti-pattern is frequent across Manila source:
msg = ("The number of %(bar)ses found is %(quux)d that exceeds limit %(lim)d.", {"bar": "wooz", "quux": 14, "lim": 9})
LOG.error(msg)
raise exception.
This results in actual messages like:
ERROR <component> (u'The number of %(bar)ses found is %(quux)d that exceeds limit %(lim)d.', {'bar': 'wooz', 'quux': 14, 'lim': 9})
...
TRACE <component> BarQuuxException: ("The number of %(bar)ses found is %(quux)d that exceeds limit %(lim)d.", {"bar": "wooz", "quux": 14, "lim": 9})
While a properly formatted message would be:
The number of woozes found is 14 that exceeds limit 9.
For a real life example please see the attachment of https:/
https:/
summary: |
- Formatting errors in log messages leave % placeholders unresolved + Formatting anti-pattern in log messages leave % placeholders unresolved |
Changed in manila: | |
assignee: | nobody → Csaba Henk (chenk) |
importance: | Undecided → Low |
milestone: | none → kilo-rc1 |
status: | New → Triaged |
Changed in manila: | |
assignee: | Csaba Henk (chenk) → Ramana Raja (rraja) |
description: | updated |
Changed in manila: | |
status: | Fix Committed → Fix Released |
Changed in manila: | |
milestone: | kilo-rc1 → 2015.1.0 |
Fix proposed to branch: master /review. openstack. org/171201
Review: https:/