@since 0.0.1
@author Igor Ivanovic
@method Logger#clean

@description
Clean message for write
@return string
436734
function Logger_clean(message) {
            if (Type.isString(message)) {
                replace.forEach(function (value) {
                    message = message.replace(value, '');
                });
                message = message.replace(/\\'/g, "'");
                message = message.replace(/\\n/g, "\n");
                return message.replace(/\\u001b/g, '\u001b');
            }
            return message;
        }
294980
function clean() {
    swig.log.info('', 'Cleaning the /public directory...');

    let paths = [
      './public/**/{target}/**/*',
      '!./public/**/{target}/**/config',
      '!./public/**/{target}/**/config/**/*',
      '!./public/**/{target}/**/src',
      '!./public/**/{target}/**/src/**/*',
      '!./public/css/{target}/main.less',
      '!./public/spec/{target}/**/*'
    ];

    paths = _.map(paths, p => p.replace('{target}', swig.pkg.name));
    const files = glob.sync(paths);

    swig.log.verbose(`[clean] ${files.length} files found at: `);
    swig.log.verbose(paths);

    _.each(files, (file) => {
      swig.log.verbose(`[clean] removing: ${file}`);
      rimraf.sync(path.normalize(file));
    });
  }
272112
public function cleanLog()
    {
        foreach ($this->logHandlers as $logHandler) {
            $logHandler->cleanLog(Config::get('activitylog.deleteRecordsOlderThanMonths'));
        }

        return true;
    }
1278016
public function write(): string
    {
        $this->targetFile->removeIfExists();

        return $this->fileWriter->write($this->targetFile);
    }
1189525
public function toCleanString() : string
    {
        $path = array_filter($this->path, function ($val) {
            return $val != Structure::ARRAY_NAME;
        });
        return implode('.', $path);
    }
1176454
public function tidy()
	{
		trigger_error('Function not implemented yet');

		$str = preg_replace([
			'/\x{2026}/u',
			'/[\x{201C}\x{201D}]/u',
			'/[\x{2018}\x{2019}]/u',
			'/[\x{2013}\x{2014}]/u',
		], [
			'...',
			'"',
			"'",
			'-',
		], $this->str);

		return static::create($str, $this->encoding);
	}
741815
function clean_string($str)
	{
		if ($this->_is_ascii($str) === FALSE)
		{
			$str = @iconv('UTF-8', 'UTF-8//IGNORE', $str);
		}

		return $str;
	}
466006
private function verboseOutput()
    {
        $log = null;
        $this->log("### Summary of verbose log");
        $this->log("As JSON: \n" . $this->json());
        $this->log("Memory peak: " . round(memory_get_peak_usage() /1024/1024) . "M");
        $this->log("Memory limit: " . ini_get('memory_limit'));

        $included = get_included_files();
        $this->log("Included files: " . count($included));

        foreach ($this->log as $val) {
            if (is_array($val)) {
                foreach ($val as $val1) {
                    $log .= htmlentities($val1) . '<br/>';
                }
            } else {
                $log .= htmlentities($val) . '<br/>';
            }
        }

        if (!is_null($this->verboseFileName)) {
            file_put_contents(
                $this->verboseFileName,
                str_replace("<br/>", "\n", $log)
            );
        } else {
            echo <<<EOD
<h1>CImage Verbose Output</h1>
<pre>{$log}</pre>
EOD;
        }
    }
453084
private function logWriteFile()
    {
        $cfg = $this->form->cfg;
        $file = $cfg['logFile'];
        $keys = \array_column($this->columns, 'key');
        $values = \array_column($this->columns, 'values');
        $appendFile = false;
        $keyCounts = array();       // for indexing keys of same name
        foreach ($keys as $k => $key) {
            $key = \trim(\strtolower($key));
            if (!isset($keyCounts[$key])) {
                $keyCounts[$key] = 1;
            } else {
                $keyCounts[$key]++;
                $key .= ' '.$keyCounts[$key];
            }
            $keys[$k] = $key;
        }
        if (\file_exists($file)) {
            $this->debug->log('log exists');
            // check that the keys in file match the data we're writing
            $handle = \fopen($file, 'rb');
            $keysExisting = \fgetcsv($handle, 4096, $cfg['logDelimitter']);
            \fclose($handle);
            if ($keysExisting === $keys) {
                $appendFile = true;
            }
        } else {
            $this->debug->log($file.' does not exist');
        }
        if ($appendFile) {
            $appendString = ArrayUtil::implodeDelim($values, $cfg['logDelimitter']);
            $return = FileIo::safeFileAppend($file, $appendString);
        } else {
            $rows = FileIo::readDelimFile($file);
            $rows[] = \array_combine($keys, $values);
            $return = FileIo::writeDelimFile($file, $rows, array(
                'char' => $cfg['log_delimitter']
            ));
        }
        return $return;
    }
669297
function clean($arg,$tags=NULL) {
		$fw=$this;
		return $this->recursive($arg,
			function($val) use($fw,$tags) {
				if ($tags!='*')
					$val=trim(strip_tags($val,
						'<'.implode('><',$fw->split($tags)).'>'));
				return trim(preg_replace(
					'/[\x00-\x08\x0B\x0C\x0E-\x1F]/','',$val));
			}
		);
	}
787402
def logger
      if !@log_file.respond_to?(:write)
        STDOUT.reopen(File.open(@log_file, (File::WRONLY | File::APPEND | File::CREAT)))
      end
      @logger = Logger.new(STDOUT)
    end
721050
public function write()
    {
        if (!count($this->sndQueue)) {
            return false;
        }

        $line   = array_shift($this->sndQueue);
        $logger = \Plop\Plop::getInstance();

        // Make sure we send the whole line,
        // with a trailing CR LF sequence.
        $eol    = $this->eol[count($this->eol) - 1];
        $line  .= $eol;
        $len    = strlen($line);
        for ($written = 0; $written < $len; $written += $fwrite) {
            $fwrite = @fwrite($this->socket, substr($line, $written));
            if ($fwrite === false) {
                return false;
            }
        }
        $line = substr($line, 0, -strlen($eol));
        $logger->debug(
            '%(line)s',
            array('line' => addcslashes($line, "\000..\037"))
        );
        return $written;
    }
1121259
public String clean(final Reader cobolReader) throws CleanerException {
        if (_log.isDebugEnabled()) {
            _log.debug("1. Cleaning COBOL source code");
        }
        switch (getConfig().getCodeFormat()) {
        case FIXED_FORMAT:
            CobolFixedFormatSourceCleaner fixedCleaner = new CobolFixedFormatSourceCleaner(
                    getErrorHandler(), getConfig().getStartColumn(), getConfig()
                            .getEndColumn());
            return fixedCleaner.clean(cobolReader);
        case FREE_FORMAT:
            CobolFreeFormatSourceCleaner freeCleaner = new CobolFreeFormatSourceCleaner(
                    getErrorHandler());
            return freeCleaner.clean(cobolReader);
        default:
            throw new CleanerException("Unkown COBOL source format "
                    + getConfig().getCodeFormat());
        }
    }
457566
public static function flush()
    {
        // Check content type
        $html = true;
        foreach (headers_list() as $header) {
            if (stripos($header, 'content-type:') === 0) {
                if (stripos($header, 'application/javascript') !== false ||
                    stripos($header, 'text/javascript') !== false
                ) {
                    $html = false;
                } elseif (stripos($header, 'text/html') === false) {
                    return;
                }
                break;
            }
        }

        if (count(static::$messages)) {
            if ($html) {
                echo '<script>' , static::generateScript() , '</script>';
            } else {
                echo static::generateScript();
            }
        }
        static::$messages = [];
    }
236099
protected function _cleanCurrent() {
        if (!$this->_states->is('panel')) {
            return '';
        }
        $current = $this->_states->getValue('part');
        if ($current === null) {
            return '';
        }
        $out = $this->formatTemplate($current.'End', []);
        if ($this->_states->getValue('collapsible')) {
            $ctplt = $current.'CollapsibleEnd';
            if ($this->getTemplates($ctplt)) {
                $out = $this->formatTemplate($ctplt, [
                    $current.'End' => $out
                ]);
            }
        }
        $this->_states->setValue('part', null);
        return $out;
    }
1027067
public static function write() 
	{
		if ( empty( static::$_data ) )
		{
			return;
		}
		
		$buffer = date("H:i:s")." - ".CCServer::method().' '.CCServer::server('REQUEST_URI')."\n";
		$buffer .= implode( "\n", static::$_data );
		
		CCFile::append( CCStorage::path( 'logs/'.date( 'Y-m' ).'/'.date( 'd' ).'.log' ), $buffer."\n" );
		
		// clear
		static::clear();
	}
1291538
public function clean()
	{
		if ($this->output->isInteractive())
		{
			$performed = 0;
			$proceed   = $this->output->getResponse('Do you want to purge all rollback points except the latest? [y|n]');

			if ($proceed == 'y' || $proceed == 'yes')
			{
				$this->mechanism->purgeRollbackPoints();
				$this->output->addLine('Purging rollback points.');
				$performed++;
			}

			$proceed = $this->output->getResponse('Do you want to purge all stashed changes? [y|n]');

			if ($proceed == 'y' || $proceed == 'yes')
			{
				$this->mechanism->purgeStash();
				$this->output->addLine('Purging repository stash.');
				$performed++;
			}

			$this->output->addLine("Clean up complete. Performed ({$performed}/2) cleanup operations available.");
		}
		else
		{
			$didSomething = false;
			if ($this->arguments->getOpt('purge-rollback-points'))
			{
				$this->mechanism->purgeRollbackPoints();
				$this->output->addLine('Purging rollback points.');
				$didSomething = true;
			}

			if ($this->arguments->getOpt('purge-stash'))
			{
				$this->mechanism->purgeStash();
				$this->output->addLine('Purging repository stash.');
				$didSomething = true;
			}

			if (!$didSomething)
			{
				$this->output->addLine('Please specify which cleanup operations to perform');
			}
		}
	}