summaryrefslogtreecommitdiffstats
path: root/core/modules/rest/src/Plugin/ResourceBase.php
diff options
context:
space:
mode:
authorNathaniel Catchpole2014-07-31 12:44:46 (GMT)
committerNathaniel Catchpole2014-07-31 12:46:06 (GMT)
commita91ef2b8538f2a03fd704d2ac0d906234750c7a4 (patch)
treed01597718ff8ed98066e8d1d1c9ba9450042f8c4 /core/modules/rest/src/Plugin/ResourceBase.php
parentced85d104ad34336a251ea8eb9fc322aae940746 (diff)
Issue #2272481 by herom, ParisLiakos, tim.plunkett: Remove usages of watchdog() from forms, plugins and controllers.
Diffstat (limited to 'core/modules/rest/src/Plugin/ResourceBase.php')
-rw-r--r--core/modules/rest/src/Plugin/ResourceBase.php16
1 files changed, 14 insertions, 2 deletions
diff --git a/core/modules/rest/src/Plugin/ResourceBase.php b/core/modules/rest/src/Plugin/ResourceBase.php
index cab3b59..0cf3281 100644
--- a/core/modules/rest/src/Plugin/ResourceBase.php
+++ b/core/modules/rest/src/Plugin/ResourceBase.php
@@ -10,6 +10,7 @@ namespace Drupal\rest\Plugin;
use Drupal\Core\Access\AccessManagerInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\Core\Plugin\PluginBase;
+use Psr\Log\LoggerInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\Routing\Route;
use Symfony\Component\Routing\RouteCollection;
@@ -34,6 +35,13 @@ abstract class ResourceBase extends PluginBase implements ContainerFactoryPlugin
protected $serializerFormats = array();
/**
+ * A logger instance.
+ *
+ * @var \Psr\Log\LoggerInterface
+ */
+ protected $logger;
+
+ /**
* Constructs a Drupal\rest\Plugin\ResourceBase object.
*
* @param array $configuration
@@ -44,10 +52,13 @@ abstract class ResourceBase extends PluginBase implements ContainerFactoryPlugin
* The plugin implementation definition.
* @param array $serializer_formats
* The available serialization formats.
+ * @param \Psr\Log\LoggerInterface $logger
+ * A logger instance.
*/
- public function __construct(array $configuration, $plugin_id, $plugin_definition, array $serializer_formats) {
+ public function __construct(array $configuration, $plugin_id, $plugin_definition, array $serializer_formats, LoggerInterface $logger) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->serializerFormats = $serializer_formats;
+ $this->logger = $logger;
}
/**
@@ -58,7 +69,8 @@ abstract class ResourceBase extends PluginBase implements ContainerFactoryPlugin
$configuration,
$plugin_id,
$plugin_definition,
- $container->getParameter('serializer.formats')
+ $container->getParameter('serializer.formats'),
+ $container->get('logger.factory')->get('rest')
);
}