for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* XMPP Library
*
* Copyright (C) 2016, Some right reserved.
* @author Kacper "Kadet" Donat <[email protected]>
* Contact with author:
* Xmpp: [email protected]
* E-mail: [email protected]
* From Kadet with love.
*/
namespace Kadet\Xmpp\Utils;
use Psr\Log\LoggerInterface;
use Psr\Log\NullLogger;
trait Logging
{
private static $global = null;
/** @var LoggerInterface */
private $logger = null;
public static function setGlobalLogger(LoggerInterface $logger)
self::$global = $logger;
}
* @return LoggerInterface
public function getLogger()
if ($this->logger === null) {
$this->logger = self::getGlobalLogger();
return $this->logger;
public function setLogger(LoggerInterface $logger)
$this->logger = $logger;
public static function getGlobalLogger()
if (self::$global === null) {
self::$global = new NullLogger();
return self::$global;