← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1596829] Re: String interpolation should be delayed at logging calls

 

Reviewed:  https://review.openstack.org/339268
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=5cef3f726e00ab2b22e3eca2b1050a431547fb85
Submitter: Jenkins
Branch:    master

commit 5cef3f726e00ab2b22e3eca2b1050a431547fb85
Author: Takashi NATSUME <natsume.takashi@xxxxxxxxxxxxx>
Date:   Thu Jul 7 22:19:33 2016 +0900

    Add a hacking rule for string interpolation at logging
    
    String interpolation should be delayed to be handled
    by the logging code, rather than being done
    at the point of the logging call.
    So add a hacking rule for it.
    
    See the oslo i18n guideline.
    
    * http://docs.openstack.org/developer/oslo.i18n/guidelines.html
    
    Change-Id: I91e8d59d508c594256d5f74514e62f8f928d1df5
    Closes-Bug: #1596829


** Changed in: neutron
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1596829

Title:
  String interpolation should be delayed at logging calls

Status in Ceilometer:
  New
Status in Cinder:
  New
Status in Glance:
  New
Status in glance_store:
  New
Status in heat:
  New
Status in Ironic:
  New
Status in OpenStack Identity (keystone):
  New
Status in neutron:
  Fix Released
Status in OpenStack Compute (nova):
  In Progress
Status in os-brick:
  New
Status in python-cinderclient:
  New
Status in python-glanceclient:
  New
Status in OpenStack Object Storage (swift):
  New
Status in taskflow:
  New

Bug description:
  String interpolation should be delayed to be handled by the logging
  code, rather than being done at the point of the logging call.

  Wrong: LOG.debug('Example: %s' % 'bad')
  Right: LOG.debug('Example: %s', 'good')

  See the following guideline.

  * http://docs.openstack.org/developer/oslo.i18n/guidelines.html
  #adding-variables-to-log-messages

  The rule for it should be added to hacking checks.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ceilometer/+bug/1596829/+subscriptions


References