示例#1
0
 function testFileLogger()
 {
     $sep = DIRECTORY_SEPARATOR;
     $fName = dirname(__FILE__) . $sep . 'data' . $sep . 'general.log';
     $this->fl = $logger = new FileLogger($fName, null, Logger::DEVEL);
     $logger->reset();
     $logger->devel('1');
     $logger->debug('2');
     $logger->info('3');
     $logger->warn('4');
     $logger->error('5');
     $len = filesize($fName);
     if ($len !== 161) {
         return "{$len} bytes instead of 161 bytes";
     }
     $len = strlen($logger->get());
     if ($len !== 161) {
         return "{$len} chars instead 161 chars";
     }
 }