X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fdrush%2Fdrush%2Flib%2FDrush%2FLog%2FDrushLog.php;fp=vendor%2Fdrush%2Fdrush%2Flib%2FDrush%2FLog%2FDrushLog.php;h=0000000000000000000000000000000000000000;hp=c2323e8b1f3f6f21d0a41c8bad0f14834b64a80a;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/vendor/drush/drush/lib/Drush/Log/DrushLog.php b/vendor/drush/drush/lib/Drush/Log/DrushLog.php deleted file mode 100644 index c2323e8b1..000000000 --- a/vendor/drush/drush/lib/Drush/Log/DrushLog.php +++ /dev/null @@ -1,109 +0,0 @@ -parser = $parser; - $this->logger = $logger; - } - - /** - * {@inheritdoc} - */ - public function log($level, $message, array $context = array()) { - // Translate the RFC logging levels into their Drush counterparts, more or - // less. - // @todo ALERT, CRITICAL and EMERGENCY are considered show-stopping errors, - // and they should cause Drush to exit or panic. Not sure how to handle this, - // though. - switch ($level) { - case RfcLogLevel::ALERT: - case RfcLogLevel::CRITICAL: - case RfcLogLevel::EMERGENCY: - case RfcLogLevel::ERROR: - $error_type = LogLevel::ERROR; - break; - - case RfcLogLevel::WARNING: - $error_type = LogLevel::WARNING; - break; - - // TODO: RfcLogLevel::DEBUG should be 'debug' rather than 'notice'? - case RfcLogLevel::DEBUG: - case RfcLogLevel::INFO: - case RfcLogLevel::NOTICE: - $error_type = LogLevel::NOTICE; - break; - - // TODO: Unknown log levels that are not defined - // in Psr\Log\LogLevel or Drush\Log\LogLevel SHOULD NOT be used. See - // https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md - // We should convert these to 'notice'. - default: - $error_type = $level; - break; - } - - // Populate the message placeholders and then replace them in the message. - $message_placeholders = $this->parser->parseMessagePlaceholders($message, $context); - - // Filter out any placeholders that can not be cast to strings. - $message_placeholders = array_filter($message_placeholders, function ($element) { - return is_scalar($element) || is_callable([$element, '__toString']); - }); - - $message = empty($message_placeholders) ? $message : strtr($message, $message_placeholders); - - $this->logger->log($error_type, $message, $context); - } - -}