Chris@0: Chris@0: * Chris@0: * For the full copyright and license information, please view the LICENSE Chris@0: * file that was distributed with this source code. Chris@0: */ Chris@0: Chris@0: namespace Symfony\Component\Debug; Chris@0: Chris@0: use Psr\Log\AbstractLogger; Chris@0: Chris@0: /** Chris@0: * A buffering logger that stacks logs for later. Chris@0: * Chris@0: * @author Nicolas Grekas
Chris@0: */ Chris@0: class BufferingLogger extends AbstractLogger Chris@0: { Chris@0: private $logs = array(); Chris@0: Chris@0: public function log($level, $message, array $context = array()) Chris@0: { Chris@0: $this->logs[] = array($level, $message, $context); Chris@0: } Chris@0: Chris@0: public function cleanLogs() Chris@0: { Chris@0: $logs = $this->logs; Chris@0: $this->logs = array(); Chris@0: Chris@0: return $logs; Chris@0: } Chris@0: }