class DrushLog implements LoggerInterface, LoggerAwareInterface (View source)

Redirects Drupal logging messages to Drush log.

Note that Drupal extends the LoggerInterface, and needlessly replaces Psr\Log\LogLevels with Drupal\Core\Logger\RfcLogLevel. Doing this arguably violates the Psr\Log contract, but we can't help that here -- we just need to convert back.

Traits

LoggerAwareTrait
RfcLoggerTrait

Properties

protected LogMessageParserInterface $parser The message's placeholders parser.

Methods

__construct(LogMessageParserInterface $parser, LoggerInterface $logger)

Constructs a DrushLog object.

log($level, $message, array $context = [])

{@inheritdoc}

Details

__construct(LogMessageParserInterface $parser, LoggerInterface $logger)

Constructs a DrushLog object.

Parameters

LogMessageParserInterface $parser
LoggerInterface $logger

log($level, $message, array $context = [])

{@inheritdoc}

Parameters

$level
$message
array $context