← 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/484250
Committed: https://git.openstack.org/cgit/openstack/keystone/commit/?id=d02a66d6bf1d222db23d1c14f8c0b53564d28cf2
Submitter: Jenkins
Branch:    master

commit d02a66d6bf1d222db23d1c14f8c0b53564d28cf2
Author: ForestLee <lichl@xxxxxxxxxxx>
Date:   Mon Jul 17 13:39:19 2017 +0800

    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.
    See the oslo i18n guideline
    * https://docs.openstack.org/oslo.i18n/latest/user/guidelines.html#adding-variables-to-log-messages
    and
    * https://github.com/openstack-dev/hacking/blob/master/hacking/checks/other.py#L39
    Closes-Bug: #1596829
    
    Change-Id: Iba231be2476dcbeeb0edd76d6a921e549d183758


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

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

Title:
  String interpolation should be delayed at logging calls

Status in congress:
  Fix Released
Status in ec2-api:
  Confirmed
Status in Glance:
  In Progress
Status in glance_store:
  In Progress
Status in Glare:
  New
Status in OpenStack Dashboard (Horizon):
  Fix Released
Status in Ironic:
  Fix Released
Status in OpenStack Identity (keystone):
  Fix Released
Status in masakari:
  Fix Released
Status in networking-vsphere:
  Fix Released
Status in OpenStack Compute (nova):
  Fix Released
Status in os-brick:
  Fix Released
Status in os-vif:
  Fix Released
Status in Glance Client:
  Fix Released
Status in python-manilaclient:
  Fix Released
Status in python-openstackclient:
  Fix Released
Status in python-troveclient:
  Fix Released
Status in senlin:
  Invalid
Status in watcher:
  In Progress
Status in Zun:
  In Progress

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/congress/+bug/1596829/+subscriptions


References