]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
getLogger should be called after logging is configured
authorDavanum Srinivas <dims@linux.vnet.ibm.com>
Wed, 27 Mar 2013 19:17:44 +0000 (15:17 -0400)
committerDavanum Srinivas <dims@linux.vnet.ibm.com>
Thu, 28 Mar 2013 12:54:50 +0000 (08:54 -0400)
logging needs to be setup properly before we try to log
something. Fixed one spot from logging->LOG

Fixes LP# 1161038

Change-Id: I87743cff9062e47c1d5e989c2c0c05c3921b65c7

bin/cinder-all

index e3c74eff8c412e41b5ddaf4a185f06d550a46bfd..e384e89c6ab0771aef49eab84e10cde04051ad4e 100755 (executable)
@@ -46,18 +46,18 @@ from cinder import service
 from cinder import utils
 
 
-LOG = logging.getLogger('cinder.all')
-
 if __name__ == '__main__':
     flags.parse_args(sys.argv)
     logging.setup("cinder")
+    LOG = logging.getLogger('cinder.all')
+
     utils.monkey_patch()
     servers = []
     # cinder-api
     try:
         servers.append(service.WSGIService('osapi_volume'))
     except (Exception, SystemExit):
-        logging.exception(_('Failed to load %s') % '%s-api' % api)
+        LOG.exception(_('Failed to load osapi_volume'))
 
     for binary in ['cinder-volume', 'cinder-scheduler']:
         try: