1
0
mirror of https://github.com/ARM-software/devlib.git synced 2025-02-07 05:30:44 +00:00

module/cgroups: log to the class' logger

All classes in the module have a logger.  Avoid using the root logger
and use the class' logger.
This commit is contained in:
Javi Merino 2019-11-04 16:18:40 +00:00 committed by Marc Bonnici
parent 3801fe1d67
commit 5b5da7c392

View File

@ -158,16 +158,16 @@ class Controller(object):
raise ValueError('wrong type for "exclude" parameter, ' raise ValueError('wrong type for "exclude" parameter, '
'it must be a str or a list') 'it must be a str or a list')
logging.debug('Moving all tasks into %s', dest) self.logger.debug('Moving all tasks into %s', dest)
# Build list of tasks to exclude # Build list of tasks to exclude
grep_filters = '' grep_filters = ''
for comm in exclude: for comm in exclude:
grep_filters += '-e {} '.format(comm) grep_filters += '-e {} '.format(comm)
logging.debug(' using grep filter: %s', grep_filters) self.logger.debug(' using grep filter: %s', grep_filters)
if grep_filters != '': if grep_filters != '':
logging.debug(' excluding tasks which name matches:') self.logger.debug(' excluding tasks which name matches:')
logging.debug(' %s', ', '.join(exclude)) self.logger.debug(' %s', ', '.join(exclude))
for cgroup in self._cgroups: for cgroup in self._cgroups:
if cgroup != dest: if cgroup != dest:
@ -288,10 +288,8 @@ class CGroup(object):
def get(self): def get(self):
conf = {} conf = {}
logging.debug('Reading %s attributes from:', self.logger.debug('Reading %s attributes from:', self.controller.kind)
self.controller.kind) self.logger.debug(' %s', self.directory)
logging.debug(' %s',
self.directory)
output = self.target._execute_util( # pylint: disable=protected-access output = self.target._execute_util( # pylint: disable=protected-access
'cgroups_get_attributes {} {}'.format( 'cgroups_get_attributes {} {}'.format(
self.directory, self.controller.kind), self.directory, self.controller.kind),
@ -330,7 +328,7 @@ class CGroup(object):
def get_tasks(self): def get_tasks(self):
task_ids = self.target.read_value(self.tasks_file).split() task_ids = self.target.read_value(self.tasks_file).split()
logging.debug('Tasks: %s', task_ids) self.logger.debug('Tasks: %s', task_ids)
return list(map(int, task_ids)) return list(map(int, task_ids))
def add_task(self, tid): def add_task(self, tid):