Files
kimai2/tests/Mocks/TestLogger.php
2025-06-07 11:48:09 +02:00

31 lines
614 B
PHP

<?php
/*
* This file is part of the Kimai time-tracking app.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Tests\Mocks;
use Psr\Log\AbstractLogger;
class TestLogger extends AbstractLogger
{
private array $logs = [];
public function log($level, string|\Stringable $message, array $context = []): void
{
$this->logs[] = [$level, $message, $context];
}
public function cleanLogs(): array
{
$logs = $this->logs;
$this->logs = [];
return $logs;
}
}