Write a string as comment output.

@param  string  $string
@param  int     $level
@return \CupOfTea\TwoStream\Console\Writer
961355
public function comment($string, $level = null)
    {
        $this->out->level($level)->writeln("<comment>$string</comment>");
        
        return $this;
    }
773592
protected void write(OutputStream outputStream, String data, boolean terminate, int level) {
        try {
            if (data != null) {
                if (level > 0) {
                    outputStream.write(StringUtils.repeat("  ", level).getBytes(CS_UTF8));
                }
                
                outputStream.write(data.getBytes(CS_UTF8));
                
                if (terminate) {
                    outputStream.write("\n".getBytes());
                }
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
469420
public function write(string $level, string $message, array $context)
    {
        $lvl_num = Logger::getLevelNumeric($level);
        if ($lvl_num < $this->min_level)
            return;

        $fmt = $this->format($level, $message, $context);
        $this->writeLine($fmt);
    }
739718
public function write($content, $level)
    {
        $this->message = (string) $content;
        $this->level   = $level;

        if ( is_callable($this->writeBeforeHandle) )
        {
            $this->writeBefore($this->writeBeforeHandle);

            if (!$this->customMessageFormatParser)
            {
                $this->defaultMessageFormatReplaces();
            }
        }
        else
        {
            $this->defaultMessageFormatReplaces();
        }

        $this->messageFormatParser();

        if ( !$this->resource )
        {
            $this->filename = date($this->dateFormat);

            if ( !empty($this->extension) )
            {
                $this->filename .= '.' . $this->extension;
            }

            $this->resource = fopen($this->path . DIRECTORY_SEPARATOR . $this->filename, 'a');
        }

        fwrite($this->resource, $this->messageOutput . PHP_EOL);
    }
621614
public static function dump($string, $color = null, $debug = true)
    {
        if ($debug) {
            print self::formatOutput($string, $color);
            static::flush();
        }
    }
895302
public static function write($content, $level = self::DEBUG)
    {
        $now = date(' c ');
        $path = Config::get('log_path', __DIR__ . '/../../../../log');
        $destination = $path . '/mailer-' . date('Y-m-d') . '.log';
        // 自动创建日志目录
        if (!is_dir($path)) {
            mkdir($path, 0777, true);
        }
        $content = '[ ' . $level . ' ] ' . $content;
        error_log("[{$now}] " . $_SERVER['REMOTE_ADDR'] . ' ' . $_SERVER['REQUEST_URI'] . "\r\n{$content}\r\n", 3, $destination);
    }
650586
public static function indent(string $s, int $level = 1, string $chars = "\t"): string
    {
        if ($level > 0) {
            $s = static::replace($s, '#(?:^|[\r\n]+)(?=[^\r\n])#', '$0' . \str_repeat($chars, $level));
        }

        return $s;
    }
556297
protected function _randomPathSha1($string, $level) {
		$result = sha1($string);
		$randomString = '';
		$counter = 0;
		for ($i = 1; $i <= $level; $i++) {
			$counter = $counter + 2;
			$randomString .= substr($result, $counter, 2) . DS;
		}

		return $randomString;
	}
7090
public function write($string)
    {
        $handle = @fopen($this->filePath, $this->mode);
        if ($handle === false) {
            return $handle;
        }
        return @fwrite($handle, $string);


    }
1249100
public function write($string) {

            if (!$this->isWritable() || ($written = fwrite($this->stream, $string)) === false) {
                throw new \RuntimeException('Could not write in a not writable stream');
            }

            return $written;

        }
548035
public function log($data, $level = self::LEVEL_INFO, $type = null)
    {
        if (!is_string($data)) {
            $data = print_r($data, true);
        }

        file_put_contents(
            $this->getLogDirectory() . '/' . $this->getLogFilename(),
            $this->getLogMessage($data, $level, $type),
            FILE_APPEND
        );
    }
1143555
protected function write($string, $token)
    {
        if ($this->stream === null) {
            echo $string;
        } else {
            $callback = $this->stream;
            $callback($string, $token);
        }

        $this->bytes += strlen($string);
    }
894644
private function write(string $levelstr, string $msg) {
		$timestamp = gmdate(\DateTime::ATOM);
			// @codeCoverageIgnoreStart
		try {
			// @codeCoverageIgnoreEnd
			$msg = $this->one_line($msg);
			$line = $this->format($timestamp, $levelstr, $msg);
			fwrite($this->handle, $line);
			// @codeCoverageIgnoreStart
		} catch(\Exception $e) {
		}
			// @codeCoverageIgnoreEnd
	}
900436
public static function log ($message, $level = null) {
		$level = ($level !== null) ? $level : self::$default_level;
		return self::write (self::get_struct ($message, $level));
	}
1154372
protected function write(string $string, int $writer = Output::STANDARD): void
	{
		$this->output->writeLn($string, $writer);
	}
244841
protected function boldLn(string $string)
    {
        $this->bold($string);
        $this->output->writeln('');

        return $this;
    }
1050508
protected function verbose($message, $level)
    {
        if ($this->output->getVerbosity() >= $level) {
            $this->output->write($message);
        }
    }