mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-11 01:24:27 +02:00
Adding Logger Tests
This commit is contained in:
parent
7bebb03f95
commit
aee348fa02
9 changed files with 447 additions and 82 deletions
37
tests/src/Util/Logger/SyslogLoggerWrapper.php
Normal file
37
tests/src/Util/Logger/SyslogLoggerWrapper.php
Normal 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;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue