Adding Logger Tests

This commit is contained in:
Philipp Holzer 2019-03-04 23:39:14 +01:00 committed by Hypolite Petovan
parent 7bebb03f95
commit aee348fa02
9 changed files with 447 additions and 82 deletions

View file

@ -0,0 +1,37 @@
<?php
namespace Friendica\Test\src\Util\Logger;
use Friendica\Util\Introspection;
use Friendica\Util\Logger\SyslogLogger;
use Psr\Log\LogLevel;
class SyslogLoggerWrapper extends SyslogLogger
{
private $content;
public function __construct($channel, Introspection $introspection, $level = LogLevel::NOTICE, $logOpts = LOG_PID, $logFacility = LOG_USER)
{
parent::__construct($channel, $introspection, $level, $logOpts, $logFacility);
$this->content = '';
}
/**
* Gets the content from the wrapped Syslog
*
* @return string
*/
public function getContent()
{
return $this->content;
}
/**
* {@inheritdoc}
*/
protected function syslogWrapper($level, $entry)
{
$this->content .= $entry . PHP_EOL;
}
}