Пример #1
0
 /**
  * @param DAOConnected $object
  * @param string $level
  * @throws InvalidArgumentException
  */
 public function __construct($object, $level = LogLevel::DEBUG)
 {
     parent::__construct($level);
     if (!$object instanceof DAOConnected) {
         throw new InvalidArgumentException();
     }
     $this->object = $object;
 }
Пример #2
0
 /**
  * @param string $filename
  * @param string $level
  * @throws InvalidArgumentException
  */
 public function __construct($filename, $level = LogLevel::DEBUG)
 {
     parent::__construct($level);
     if (is_string($filename)) {
         $this->filename = $filename;
     } else {
         throw new InvalidArgumentException('Invalid type');
     }
     $this->setDecorator(new StreamDecorator());
 }