code: def _enable_logpersist(self):
          
          # Logpersist is only allowed on rootable devices because of excessive
          # reads/writes for persisting logs.
          if not self._ad.is_rootable:
              return
  
          logpersist_warning = ('%s encountered an error enabling persistent'
                                ' logs, logs may not get saved.')
          # Android L and older versions do not have logpersist installed,
          # so check that the logpersist scripts exists before trying to use
          # them.
          if not self._ad.adb.has_shell_command('logpersist.start'):
              logging.warning(logpersist_warning, self)
              return
  
          try:
              # Disable adb log spam filter for rootable devices. Have to stop
              # and clear settings first because 'start' doesn't support --clear
              # option before Android N.
              self._ad.adb.shell('logpersist.stop --clear')
              self._ad.adb.shell('logpersist.start')
          except adb.AdbError:
              logging.warning(logpersist_warning, self)
docs: Attempts to enable logpersist daemon to persist logs.