Remove any provisioned log sink if auto created
431265
def remove(self, func):
        """"""
        if not self.data['name'].startswith(self.prefix):
            return
        parent = self.get_parent(self.get_log())
        _, sink_path, _ = self.get_sink()
        client = self.session.client(
            'logging', 'v2', '%s.sinks' % (parent.split('/', 1)[0]))
        try:
            client.execute_command(
                'delete', {'sinkName': sink_path})
        except HttpError as e:
            if e.resp.status != 404:
                raise
40248
private void truncateUncommittedEntries() {
    if (type() == CopycatServer.State.PASSIVE) {
      context.getLog().truncate(Math.min(context.getCommitIndex(), context.getLog().lastIndex()));
    }
  }
828182
protected void removeMsgFromLogHandler(String msgId, String handlerId) {
        Set<String> logHandlerIdSet = getOrCreateLogHandlerIdSet(msgId);
        logHandlerIdSet.remove(handlerId);
    }
1000659
def sanitize_logger (self):
        """"""
        if not self['output']:
            log.warn(LOG_CHECK, _("activating text logger output."))
            self['output'] = 'text'
        self['logger'] = self.logger_new(self['output'])
53318
def cleanup(config_dir):
    """"""
    stdout_path = os.path.join(config_dir, 'pueue.stdout')
    stderr_path = os.path.join(config_dir, 'pueue.stderr')
    if os._exists(stdout_path):
        os.remove(stdout_path)
    if os._exists(stderr_path):
        os.remove(stderr_path)

    socketPath = os.path.join(config_dir, 'pueue.sock')
    if os.path.exists(socketPath):
        os.remove(socketPath)
469533
def _RemoveOsLoginNssCache(self):
    """"""
    if os.path.exists(constants.OSLOGIN_NSS_CACHE):
      try:
        os.remove(constants.OSLOGIN_NSS_CACHE)
      except OSError as e:
        if e.errno != errno.ENOENT:
          raise
307091
private void cleanLogs() throws Exception {
        File logsDir = new File(serverOutputDir.getAbsolutePath(), "logs");
        if (logsDir.exists()) {
            cleanDir(logsDir);
            log(MessageFormat.format(messages.getString("info.element.cleaned"), "logs"));
        } else {
            log(MessageFormat.format(messages.getString("info.directory.noexist"), logsDir.getAbsolutePath()));
        }
    }
1174299
def clear_logs(log_type)
      new_action = { 'Action' => 'ClearLog' }
      response = rest_post(uri_for_log_type(log_type), body: new_action)
      response_handler(response)
      true
    end
1162230
def remove_service(self, zeroconf, srv_type, srv_name):
        """"""
        self.servers.remove_server(srv_name)
        logger.info(
            "Glances server %s removed from the autodetect list" % srv_name)
581182
function () {

		SR.fs.close(l_logs[log_id].fd,
			function () {
				console.log(l_name + '::l_closeLog::' + SR.Tags.YELLOW + 'LogID=' + log_id + ' closed.' + SR.Tags.ERREND);
				delete l_logs[log_id];
				onDone(log_id);
			}
		);
	}
1321828
def remove_logger(self, cb_id):
        '''

        '''
        if cb_id not in self._loggers:
            raise exceptions.NoLoggerError(cb_id, self.name)
        conf = self.object.get_configuration()
        res = conf.remove_service_profile(cb_id.get_bytes())
        del self._loggers[cb_id]
179029
def _cleanup():
    '''
    
    '''
    for inst in _ACTIVE[:]:
        res = inst.isalive()
        if res is not True:
            try:
                _ACTIVE.remove(inst)
            except ValueError:
                # This can happen if two threads create a new Terminal instance
                # It's harmless that it was already removed, so ignore.
                pass
1172935
function cleanup() {
  const artifacts = ['.requirements'];
  if (this.options.zip) {
    if (this.serverless.service.package.individually) {
      this.targetFuncs.forEach(f => {
        artifacts.push(path.join(f.module, '.requirements.zip'));
        artifacts.push(path.join(f.module, 'unzip_requirements.py'));
      });
    } else {
      artifacts.push('.requirements.zip');
      artifacts.push('unzip_requirements.py');
    }
  }

  return BbPromise.all(
    artifacts.map(artifact =>
      fse.removeAsync(path.join(this.servicePath, artifact))
    )
  );
}
691754
private void removeOldLogs()
  {
    try {
      Path path = getPath();
      Path parent = path.getParent();

      ArrayList<String> matchList = new ArrayList<String>();

      Pattern archiveRegexp = getArchiveRegexp();
      Files.list(parent).forEach(child->{
        String subPath = child.getFileName().toString();
        
        Matcher matcher = archiveRegexp.matcher(subPath);

        if (matcher.matches())
          matchList.add(subPath);
      });

      Collections.sort(matchList);

      if (_rolloverCount <= 0 || matchList.size() < _rolloverCount)
        return;

      for (int i = 0; i + _rolloverCount < matchList.size(); i++) {
        try {
          Files.delete(parent.resolve(matchList.get(i)));
        } catch (Throwable e) {
        }
      }
    } catch (Throwable e) {
    }
  }
987479
def purgeAutoSelected(self):
        """"""
        params = self._autoParams.allData()
        for p in params:
            comps_to_remove = []
            for comp in p['selection']:
                if self.indexByComponent(comp) is None:
                    comps_to_remove.append(comp)
            for orphaned in comps_to_remove:
                p['selection'].remove(orphaned)
755108
def clean_job(logfile, outfiles, dry_run=False):
    
    remove_file(logfile, dry_run)
    for outfile in outfiles.values():
        remove_file(outfile, dry_run)
185280
def _teardown_log_prefix(self):
        """"""
        self._logger_console_fmtter.prefix = ''
        self._logger_console_fmtter.plugin_id = ''
        self._logger_file_fmtter.prefix = ' '
        self._logger_file_fmtter.plugin_id = ''