예제 #1
0
파일: SGLog.php 프로젝트: Finzy/stageDB
 public static function removeAllHandlers($level = 0)
 {
     if ($level == 0) {
         self::$logHandlers = array();
         return;
     }
     $handlers = array();
     foreach (self::$logHandlers as $logHandler) {
         if (!self::levelBelongsToLevel($level, $logHandler['level'])) {
             $handlers[] = $logHandler;
         }
     }
     self::$logHandlers = $handlers;
 }
예제 #2
0
파일: SGBackup.php 프로젝트: Finzy/stageDB
 private function prepareRestoreLogFile($backupPath)
 {
     $file = $backupPath . '/' . $this->fileName . '_restore.log';
     $this->restoreLogPath = $file;
     $content = self::getLogFileHeader();
     $content .= PHP_EOL;
     if (!file_put_contents($file, $content)) {
         throw new SGExceptionMethodNotAllowed('Cannot create restore log file: ' . $file);
     }
     //create file log handler
     $fileLogHandler = new SGFileLogHandler($file);
     SGLog::registerLogHandler($fileLogHandler, SG_LOG_LEVEL_LOW, true);
 }
예제 #3
0
 public static function clear($level = SG_LOG_LEVEL_LOW)
 {
     SGLog::clear($level);
 }