Don't translate debug level logs in objectstore, pci, rdp, servicegroup
Our translation policy (https://wiki.openstack.org/wiki/LoggingStandards#Log_Translation) calls for not translating debug level logs. This is to help prioritize log translation. Furthermore translation has a performance overhead, even if the log isn't used (since nova doesn't support lazy translation yet). Change-Id: I4c8e7365e1e3bae52956249f1c7d97c7729aebc3
This commit is contained in:
		@@ -224,6 +224,10 @@ def no_translate_debug_logs(logical_line, filename):
 | 
			
		||||
            "nova/hacking",
 | 
			
		||||
            "nova/ipv6",
 | 
			
		||||
            "nova/keymgr",
 | 
			
		||||
            "nova/objectstore",
 | 
			
		||||
            "nova/pci",
 | 
			
		||||
            "nova/rdp",
 | 
			
		||||
            "nova/servicegroup",
 | 
			
		||||
           ]
 | 
			
		||||
    if max([name in filename for name in dirs]):
 | 
			
		||||
        if logical_line.startswith("LOG.debug(_("):
 | 
			
		||||
 
 | 
			
		||||
@@ -61,7 +61,7 @@ class API(object):
 | 
			
		||||
        '''
 | 
			
		||||
 | 
			
		||||
        if not cls._driver:
 | 
			
		||||
            LOG.debug(_('ServiceGroup driver defined as an instance of %s'),
 | 
			
		||||
            LOG.debug('ServiceGroup driver defined as an instance of %s',
 | 
			
		||||
                      str(CONF.servicegroup_driver))
 | 
			
		||||
            driver_name = CONF.servicegroup_driver
 | 
			
		||||
            try:
 | 
			
		||||
@@ -126,15 +126,15 @@ class API(object):
 | 
			
		||||
 | 
			
		||||
    def get_all(self, group_id):
 | 
			
		||||
        """Returns ALL members of the given group."""
 | 
			
		||||
        LOG.debug(_('Returns ALL members of the [%s] '
 | 
			
		||||
                    'ServiceGroup'), group_id)
 | 
			
		||||
        LOG.debug('Returns ALL members of the [%s] '
 | 
			
		||||
                  'ServiceGroup', group_id)
 | 
			
		||||
        return self._driver.get_all(group_id)
 | 
			
		||||
 | 
			
		||||
    def get_one(self, group_id):
 | 
			
		||||
        """Returns one member of the given group. The strategy to select
 | 
			
		||||
        the member is decided by the driver (e.g. random or round-robin).
 | 
			
		||||
        """
 | 
			
		||||
        LOG.debug(_('Returns one member of the [%s] group'), group_id)
 | 
			
		||||
        LOG.debug('Returns one member of the [%s] group', group_id)
 | 
			
		||||
        return self._driver.get_one(group_id)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -78,7 +78,7 @@ class DbDriver(api.ServiceGroupDriver):
 | 
			
		||||
    def get_all(self, group_id):
 | 
			
		||||
        """Returns ALL members of the given group
 | 
			
		||||
        """
 | 
			
		||||
        LOG.debug(_('DB_Driver: get_all members of the %s group') % group_id)
 | 
			
		||||
        LOG.debug('DB_Driver: get_all members of the %s group', group_id)
 | 
			
		||||
        rs = []
 | 
			
		||||
        ctxt = context.get_admin_context()
 | 
			
		||||
        services = self.conductor_api.service_get_all_by_topic(ctxt, group_id)
 | 
			
		||||
 
 | 
			
		||||
@@ -72,7 +72,7 @@ class MemcachedDriver(api.ServiceGroupDriver):
 | 
			
		||||
    def get_all(self, group_id):
 | 
			
		||||
        """Returns ALL members of the given group
 | 
			
		||||
        """
 | 
			
		||||
        LOG.debug(_('Memcached_Driver: get_all members of the %s group') %
 | 
			
		||||
        LOG.debug('Memcached_Driver: get_all members of the %s group',
 | 
			
		||||
                  group_id)
 | 
			
		||||
        rs = []
 | 
			
		||||
        ctxt = context.get_admin_context()
 | 
			
		||||
 
 | 
			
		||||
@@ -77,8 +77,8 @@ class ZooKeeperDriver(api.ServiceGroupDriver):
 | 
			
		||||
 | 
			
		||||
    def join(self, member_id, group, service=None):
 | 
			
		||||
        """Join the given service with its group."""
 | 
			
		||||
        LOG.debug(_('ZooKeeperDriver: join new member %(id)s to the '
 | 
			
		||||
                    '%(gr)s group, service=%(sr)s'),
 | 
			
		||||
        LOG.debug('ZooKeeperDriver: join new member %(id)s to the '
 | 
			
		||||
                  '%(gr)s group, service=%(sr)s',
 | 
			
		||||
                  {'id': member_id, 'gr': group, 'sr': service})
 | 
			
		||||
        member = self._memberships.get((group, member_id), None)
 | 
			
		||||
        if member is None:
 | 
			
		||||
@@ -98,7 +98,7 @@ class ZooKeeperDriver(api.ServiceGroupDriver):
 | 
			
		||||
 | 
			
		||||
    def leave(self, member_id, group):
 | 
			
		||||
        """Remove the given member from the service group."""
 | 
			
		||||
        LOG.debug(_('ZooKeeperDriver.leave: %(member)s from group %(group)s'),
 | 
			
		||||
        LOG.debug('ZooKeeperDriver.leave: %(member)s from group %(group)s',
 | 
			
		||||
                  {'member': member_id, 'group': group})
 | 
			
		||||
        try:
 | 
			
		||||
            key = (group, member_id)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user