4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\HttpKernel\Tests;
14 use Psr\Log\LoggerInterface;
16 class Logger implements LoggerInterface
20 public function __construct()
25 public function getLogs($level = false)
27 return false === $level ? $this->logs : $this->logs[$level];
30 public function clear()
33 'emergency' => array(),
35 'critical' => array(),
44 public function log($level, $message, array $context = array())
46 $this->logs[$level][] = $message;
49 public function emergency($message, array $context = array())
51 $this->log('emergency', $message, $context);
54 public function alert($message, array $context = array())
56 $this->log('alert', $message, $context);
59 public function critical($message, array $context = array())
61 $this->log('critical', $message, $context);
64 public function error($message, array $context = array())
66 $this->log('error', $message, $context);
69 public function warning($message, array $context = array())
71 $this->log('warning', $message, $context);
74 public function notice($message, array $context = array())
76 $this->log('notice', $message, $context);
79 public function info($message, array $context = array())
81 $this->log('info', $message, $context);
84 public function debug($message, array $context = array())
86 $this->log('debug', $message, $context);
92 public function emerg($message, array $context = array())
94 @trigger_error('Use emergency() which is PSR-3 compatible', E_USER_DEPRECATED);
96 $this->log('emergency', $message, $context);
102 public function crit($message, array $context = array())
104 @trigger_error('Use critical() which is PSR-3 compatible', E_USER_DEPRECATED);
106 $this->log('critical', $message, $context);
112 public function err($message, array $context = array())
114 @trigger_error('Use error() which is PSR-3 compatible', E_USER_DEPRECATED);
116 $this->log('error', $message, $context);
122 public function warn($message, array $context = array())
124 @trigger_error('Use warning() which is PSR-3 compatible', E_USER_DEPRECATED);
126 $this->log('warning', $message, $context);