linkmobility-php-client/src/LoggerHandler.php

56 lines
1.1 KiB
PHP

<?php
/**
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* https://www.d3data.de
*
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
* @author D3 Data Development - Daniel Seifert <support@shopmodule.com>
* @link https://www.oxidmodule.com
*/
declare(strict_types=1);
namespace D3\LinkmobilityClient;
use Psr\Log\LoggerInterface;
use Psr\Log\NullLogger;
class LoggerHandler
{
private static $instance = null;
private $logger;
public static function getInstance(): ?LoggerHandler
{
if (self::$instance === null) {
self::$instance = new self();
}
return self::$instance;
}
public function __construct()
{
$this->setLogger(new NullLogger());
}
/**
* @param mixed $logger
*/
public function setLogger(LoggerInterface $logger)
{
$this->logger = $logger;
}
/**
* @return LoggerInterface
*/
public function getLogger(): LoggerInterface
{
return $this->logger;
}
}