Beispiel #1
0
 public function __construct($Conf)
 {
     $this->Conf = $Conf;
     $logConf = $Conf->get('log');
     $this->Log = XLog::factory($logConf['type'], $logConf['name'], $logConf['option']);
     $this->Log->info('XSystem Waik');
 }
Beispiel #2
0
 function testObserver()
 {
     $handler = XLog::factory('file', 'default', array('append' => 0, 'dirname' => $this->dirname, 'filename' => 'test1.log'), XLOG_WARNING);
     $var = array();
     $observer = XLog::factoryObserver('var', array('var' => &$var), XLOG_ERR);
     $handler->attach($observer);
     $handler->open();
     $handler->info("TEST");
     $handler->notice("TEST");
     $handler->debug("TEST");
     $handler->warning("TEST");
     $handler->err("TEST");
     $handler->crit("TEST");
     $handler->close();
     $this->assertEquala(2, count($var), 'Observer Failed');
 }