Subversion Repositories cheapmusic

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
103 - 1
<?php
2
 
3
/*
4
 * This file is part of the Monolog package.
5
 *
6
 * (c) Jordi Boggiano <j.boggiano@seld.be>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
 
12
namespace Monolog\Handler;
13
 
14
use Monolog\Logger;
15
 
16
/**
17
 * Blackhole
18
 *
19
 * Any record it can handle will be thrown away. This can be used
20
 * to put on top of an existing stack to override it temporarily.
21
 *
22
 * @author Jordi Boggiano <j.boggiano@seld.be>
23
 */
24
class NullHandler extends AbstractHandler
25
{
26
    /**
27
     * @param int $level The minimum logging level at which this handler will be triggered
28
     */
29
    public function __construct($level = Logger::DEBUG)
30
    {
31
        parent::__construct($level, false);
32
    }
33
 
34
    /**
35
     * {@inheritdoc}
36
     */
37
    public function handle(array $record)
38
    {
39
        if ($record['level'] < $this->level) {
40
            return false;
41
        }
42
 
43
        return true;
44
    }
45
}