mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
API Add PHP deprecation notices to setLogger and getLogger
This commit is contained in:
parent
8854f053c8
commit
580214cc30
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user