WP_CLI\Loggers

Base::_line()protectedWP-CLI 1.0

Output one line of message to a resource.

Метод класса: Base{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->_line( $message, $label, $color, $handle );
$message(строка) (обязательный)
Message to write.
$label(строка) (обязательный)
Prefix message with a label.
$color(строка) (обязательный)
Colorize label with a given color.
$handle(resource)
Resource to write to.
По умолчанию: STDOUT

Код Base::_line() WP-CLI 2.8.0-alpha

protected function _line( $message, $label, $color, $handle = STDOUT ) { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore -- Used in third party extensions.
	if ( class_exists( 'cli\Colors' ) ) {
		$label = Colors::colorize( "$color$label:%n", $this->in_color );
	} else {
		$label = "$label:";
	}
	$this->write( $handle, "$label $message\n" );
}