private static function Log($strMessage, $intPriority, $intProjectId = null, $intLanguageId = null, $intUserId = null) { if (SERVER_INSTANCE != 'dev' && $intPriority == NarroLog::PRIORITY_DEBUG) { return true; } $objLogEntry = new NarroLog(); $objLogEntry->Date = QDateTime::Now(); $objLogEntry->Priority = $intPriority; $objLogEntry->Message = $strMessage; $objLogEntry->ProjectId = is_null($intProjectId) ? is_null(self::$intProjectId) ? null : self::$intProjectId : $intProjectId; $objLogEntry->LanguageId = is_null($intLanguageId) ? is_null(self::$intLanguageId) ? null : self::$intLanguageId : $intLanguageId; $objLogEntry->UserId = is_null($intUserId) ? is_null(self::$intUserId) ? null : self::$intUserId : $intUserId; try { $objLogEntry->Save(); } catch (Exception $objEx) { error_log($objEx->getMessage() . $objEx->getTraceAsString()); } if (QFirebug::getEnabled()) { switch ($intPriority) { case NarroLog::PRIORITY_INFO: QFirebug::info($objLogEntry->Message . ' / ' . $objLogEntry->UserId . ' / ' . $objLogEntry->ProjectId . ' / ' . $objLogEntry->LanguageId); break; case NarroLog::PRIORITY_WARN: QFirebug::warn($objLogEntry->Message . ' / ' . $objLogEntry->UserId . ' / ' . $objLogEntry->ProjectId . ' / ' . $objLogEntry->LanguageId); break; case NarroLog::PRIORITY_ERROR: QFirebug::error($objLogEntry->Message . ' / ' . $objLogEntry->UserId . ' / ' . $objLogEntry->ProjectId . ' / ' . $objLogEntry->LanguageId); break; default: QFirebug::log($objLogEntry->Message . ' / ' . $objLogEntry->UserId . ' / ' . $objLogEntry->ProjectId . ' / ' . $objLogEntry->LanguageId); } } }