WP_CLI\Loggers
Base::debug
Write a message to STDERR, prefixed with "Debug: ".
Метод класса: Base{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$Base = new Base(); $Base->debug( $message, $group );
- $message(строка) (обязательный)
- Message to write.
- $group(строка|true|false)
- Organize debug message to a specific group. Use
falsefor no group.
По умолчанию:false
Код Base::debug() Base::debug WP-CLI 2.13.0-alpha
public function debug( $message, $group = false ) {
static $start_time = null;
if ( null === $start_time ) {
$start_time = microtime( true );
}
$debug = $this->get_runner()->config['debug'];
if ( ! $debug ) {
return;
}
if ( true !== $debug && $group !== $debug ) {
return;
}
$time = round( microtime( true ) - ( defined( 'WP_CLI_START_MICROTIME' ) ? WP_CLI_START_MICROTIME : $start_time ), 3 );
$prefix = 'Debug';
if ( $group && true === $debug ) {
$prefix = 'Debug (' . $group . ')';
}
$this->_line( "$message ({$time}s)", $prefix, '%B', STDERR );
}