<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def process(self):
 """Execute the grep command"""


    for _, path in self.state.input:
      log_file_path = os.path.join(self._output_path, 'grepper.log')
      print('Log file: {0:s}'.format(log_file_path))

      print('Walking through dir (absolute) = ' + os.path.abspath(path))
      try:
        for root, _, files in os.walk(path):
          for filename in files:
            found = set()
            fullpath = '{0:s}/{1:s}'.format(os.path.abspath(root), filename)
            if mimetypes.guess_type(filename)[0] == 'application/pdf':
              found = self.grepPDF(fullpath)
            else:
              with open(fullpath, 'r') as fp:
                for line in fp:
                  found.update(set(x.lower() for x in re.findall(
                      self._keywords, line, re.IGNORECASE)))
            if [item for item in found if item]:
              output = '{0:s}/{1:s}:{2:s}'.format(path, filename, ','.join(
                  filter(None, found)))
              if self._final_output:
                self._final_output += '\n' + output
              else:
                self._final_output = output
              print(output)
      except OSError as exception:
        self.state.add_error(exception, critical=True)
        return
      # Catch all remaining errors since we want to gracefully report them
      except Exception as exception:  # pylint: disable=broad-except
        self.state.add_error(exception, critical=True)
        return