Download tests/PHPUnit/Framework/Mock/FakeLogger.php from Leon4gr45/matomo: direct link, hf CLI and curl.
- Browser
- Download file 791 Bytes
-
https://huggingface.co/spaces/Leon4gr45/matomo/resolve/main/tests/PHPUnit/Framework/Mock/FakeLogger.php
- Command line
-
hf download hf://spaces/Leon4gr45/matomo/tests/PHPUnit/Framework/Mock/FakeLogger.php
-
curl -L -o FakeLogger.php https://huggingface.co/spaces/Leon4gr45/matomo/resolve/main/tests/PHPUnit/Framework/Mock/FakeLogger.php
791 Bytes
| namespace Piwik\Tests\Framework\Mock; | |
| use Monolog\Processor\PsrLogMessageProcessor; | |
| use Psr\Log\AbstractLogger; | |
| use Piwik\Log\LoggerInterface; | |
| class FakeLogger extends AbstractLogger implements LoggerInterface | |
| { | |
| /** | |
| * @var string | |
| */ | |
| public $output = ''; | |
| /** | |
| * @var PsrLogMessageProcessor | |
| */ | |
| private $processor; | |
| public function __construct() | |
| { | |
| $this->processor = new PsrLogMessageProcessor(); | |
| } | |
| public function log($level, $message, array $context = array()) | |
| { | |
| if (strpos($message, 'Running command') !== false) { | |
| return; | |
| } | |
| $record = $this->processor->__invoke(array('message' => $message, 'context' => $context)); | |
| $this->output .= $record['message'] . PHP_EOL; | |
| } | |
| } | |