ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ChannelLevelActivationStrategy.php
Go to the documentation of this file.
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 
13 
14 use Monolog\Logger;
15 
37 {
40 
46  {
47  $this->defaultActionLevel = Logger::toMonologLevel($defaultActionLevel);
48  $this->channelToActionLevel = array_map('Monolog\Logger::toMonologLevel', $channelToActionLevel);
49  }
50 
51  public function isHandlerActivated(array $record)
52  {
53  if (isset($this->channelToActionLevel[$record['channel']])) {
54  return $record['level'] >= $this->channelToActionLevel[$record['channel']];
55  }
56 
57  return $record['level'] >= $this->defaultActionLevel;
58  }
59 }
__construct($defaultActionLevel, $channelToActionLevel=array())
static toMonologLevel($level)
Converts PSR-3 levels to Monolog ones if necessary.
Definition: Logger.php:473
Interface for activation strategies for the FingersCrossedHandler.
Channel and Error level based monolog activation strategy.
Create styles array
The data for the language used.
isHandlerActivated(array $record)
Returns whether the given record activates the handler.