/** * Init debug system * @param string $logPath path for debug log * @param int $logLevel level of debug is allowed from */ public static function init($logPath, $logLevel = self::LVL_FATAL) { if (!is_null(self::$logFile)) { fclose(self::$logFile); } self::$logFile = fopen($logPath, 'ab'); self::$logPath = $logPath; self::$logLevel = $logLevel; self::forcedInfo("------------------------------------------------------"); self::forcedInfo("Debug log enabled, level: {$logLevel}"); }