示例#1
0
 public function testDelayedInit()
 {
     ezcBaseInit::setCallback('ezcInitLog', 'testDelayedInitLog');
     $log = ezcLog::getInstance();
     $rule = new ezcLogFilterRule(new ezcLogFilter(), $writer = new ezcLogUnixFileWriter('/'), true);
     $expected = new ezcLogFilterSet();
     $expected->appendRule($rule);
     $this->assertAttributeEquals($expected, 'writers', $log);
 }
示例#2
0
 /**
  * Maps the filename $fileName to the messages specified by the {@link ezcLogFilter} $logFilter.
  *
  * Log messages that matches with the filter are written to the file $fileName. 
  *
  * @param ezcLogFilter $logFilter 
  * @param string $fileName
  */
 public function setFile(ezcLogFilter $logFilter, $fileName)
 {
     $fh = $this->openFile($fileName);
     $this->fileMap->appendRule(new ezcLogFilterRule($logFilter, $fh, true));
 }
 /**
  * Maps the table $tableName to the messages specified by the {@link ezcLogFilter} $logFilter.
  *
  * Log messages that matches with the filter are written to the table $tableName. 
  * This method works the same as {@link ezclog::map()}.
  *
  * @param ezcLogFilter $logFilter 
  * @param string $tableName
  */
 public function setTable(ezcLogFilter $logFilter, $tableName)
 {
     $this->map->appendRule(new ezcLogFilterRule($logFilter, $tableName, true));
 }