From 580214cc30785906b012d3cb6e5bea67f3b5ff34 Mon Sep 17 00:00:00 2001 From: Robbie Averill Date: Tue, 13 Nov 2018 11:12:06 +0200 Subject: [PATCH] API Add PHP deprecation notices to setLogger and getLogger --- src/Logging/MonologErrorHandler.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Logging/MonologErrorHandler.php b/src/Logging/MonologErrorHandler.php index 81b1837fd..28f355c32 100644 --- a/src/Logging/MonologErrorHandler.php +++ b/src/Logging/MonologErrorHandler.php @@ -5,6 +5,7 @@ namespace SilverStripe\Logging; use InvalidArgumentException; use Psr\Log\LoggerInterface; use Monolog\ErrorHandler as MonologHandler; +use SilverStripe\Dev\Deprecation; class MonologErrorHandler implements ErrorHandler { @@ -23,6 +24,8 @@ class MonologErrorHandler implements ErrorHandler */ public function setLogger(LoggerInterface $logger) { + Deprecation::notice('4.4.0', 'Please use pushHandler() instead'); + $this->loggers = [$logger]; return $this; } @@ -35,6 +38,8 @@ class MonologErrorHandler implements ErrorHandler */ public function getLogger() { + Deprecation::notice('4.4.0', 'Please use getHandlers() instead'); + return reset($this->loggers); }