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; }
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); }
public static function clear($level = SG_LOG_LEVEL_LOW) { SGLog::clear($level); }