Пример #1
0
 /**
  * This constructor initializes the class with the specified parameters.
  *
  * @access public
  * @param Common\Mutable\IMap $blackboard                   the blackboard to be used
  * @param Common\Mutable\IMap $policy                       the policy associated with the task
  */
 public function __construct(Common\Mutable\IMap $blackboard = null, Common\Mutable\IMap $policy = null)
 {
     parent::__construct($blackboard, $policy);
     $this->level = Log\Level::informational();
     $this->logger = Log\Manager::instance();
 }
Пример #2
0
 /**
  * This method logs the specified message with an arbitrary level.
  *
  * @access public
  * @param mixed $level                                      the log level assigned to the message
  * @param string $message                                   the message to be logged
  * @param array $context                                    the values to replace in the message
  * @return null
  */
 public function log($level, $message, array $context = array())
 {
     if (is_string($level)) {
         $level = strtolower($level);
         Log\Manager::instance()->add(Log\Level::$level(), $message, $context);
     } else {
         Log\Manager::instance()->add($level, $message, $context);
     }
 }