当前位置: 首页>>代码示例>>PHP>>正文


PHP MWExceptionHandler::getLogMessage方法代码示例

本文整理汇总了PHP中MWExceptionHandler::getLogMessage方法的典型用法代码示例。如果您正苦于以下问题:PHP MWExceptionHandler::getLogMessage方法的具体用法?PHP MWExceptionHandler::getLogMessage怎么用?PHP MWExceptionHandler::getLogMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MWExceptionHandler的用法示例。


在下文中一共展示了MWExceptionHandler::getLogMessage方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: rollbackMasterChangesAndLog

 /**
  * If there are any open database transactions, roll them back and log
  * the stack trace of the exception that should have been caught so the
  * transaction could be aborted properly.
  *
  * @since 1.23
  * @param Exception $e
  */
 public static function rollbackMasterChangesAndLog(Exception $e)
 {
     $factory = wfGetLBFactory();
     if ($factory->hasMasterChanges()) {
         wfDebugLog('Bug56269', 'Exception thrown with an uncommited database transaction: ' . MWExceptionHandler::getLogMessage($e) . "\n" . $e->getTraceAsString());
         $factory->rollbackMasterChanges();
     }
 }
开发者ID:D66Ha,项目名称:mediawiki,代码行数:16,代码来源:MWExceptionHandler.php

示例2: formatExceptionNoComment

 /**
  * Handle exception display.
  *
  * @since 1.25
  * @param Exception $e Exception to be shown to the user
  * @return string Sanitized text that can be returned to the user
  */
 protected static function formatExceptionNoComment($e)
 {
     global $wgShowExceptionDetails;
     if (!$wgShowExceptionDetails) {
         return MWExceptionHandler::getPublicLogMessage($e);
     }
     return MWExceptionHandler::getLogMessage($e);
 }
开发者ID:agothro,项目名称:mediawiki,代码行数:15,代码来源:ResourceLoader.php

示例3: report

 /**
  * Report an exception to the user
  */
 protected static function report(Exception $e)
 {
     global $wgShowExceptionDetails;
     $cmdLine = MWException::isCommandLine();
     if ($e instanceof MWException) {
         try {
             // Try and show the exception prettily, with the normal skin infrastructure
             $e->report();
         } catch (Exception $e2) {
             // Exception occurred from within exception handler
             // Show a simpler error message for the original exception,
             // don't try to invoke report()
             $message = "MediaWiki internal error.\n\n";
             if ($wgShowExceptionDetails) {
                 $message .= 'Original exception: ' . self::getLogMessage($e) . "\nBacktrace:\n" . self::getRedactedTraceAsString($e) . "\n\nException caught inside exception handler: " . self::getLogMessage($e2) . "\nBacktrace:\n" . self::getRedactedTraceAsString($e2);
             } else {
                 $message .= "Exception caught inside exception handler.\n\n" . "Set \$wgShowExceptionDetails = true; at the bottom of LocalSettings.php " . "to show detailed debugging information.";
             }
             $message .= "\n";
             if ($cmdLine) {
                 self::printError($message);
             } else {
                 echo nl2br(htmlspecialchars($message)) . "\n";
             }
         }
     } else {
         $message = "Unexpected non-MediaWiki exception encountered, of type \"" . get_class($e) . "\"";
         if ($wgShowExceptionDetails) {
             $message .= "\n" . MWExceptionHandler::getLogMessage($e) . "\nBacktrace:\n" . self::getRedactedTraceAsString($e) . "\n";
         }
         if ($cmdLine) {
             self::printError($message);
         } else {
             echo nl2br(htmlspecialchars($message)) . "\n";
         }
     }
 }
开发者ID:biribogos,项目名称:wikihow-src,代码行数:40,代码来源:Exception.php

示例4: getText

 /**
  * Get the text to display when reporting the error on the command line.
  * If $wgShowExceptionDetails is true, return a text message with a
  * backtrace to the error.
  *
  * @return string
  */
 public function getText()
 {
     global $wgShowExceptionDetails;
     if ($wgShowExceptionDetails) {
         return MWExceptionHandler::getLogMessage($this) . "\nBacktrace:\n" . MWExceptionHandler::getRedactedTraceAsString($this) . "\n";
     } else {
         return "Set \$wgShowExceptionDetails = true; " . "in LocalSettings.php to show detailed debugging information.\n";
     }
 }
开发者ID:whysasse,项目名称:kmwiki,代码行数:16,代码来源:MWException.php

示例5: getLogMessage

 /**
  * Return the requested URL and point to file and line number from which the
  * exception occurred
  *
  * @since 1.8
  * @deprecated since 1.22 Use MWExceptionHandler::getLogMessage instead.
  * @return string
  */
 public function getLogMessage()
 {
     wfDeprecated(__METHOD__, '1.22');
     return MWExceptionHandler::getLogMessage($this);
 }
开发者ID:Tarendai,项目名称:spring-website,代码行数:13,代码来源:MWException.php

示例6: getText

 /**
  * @param Exception|Throwable $e
  * @return string
  */
 private static function getText($e)
 {
     if (self::showBackTrace($e)) {
         return MWExceptionHandler::getLogMessage($e) . "\nBacktrace:\n" . MWExceptionHandler::getRedactedTraceAsString($e) . "\n";
     } else {
         return "Set \$wgShowExceptionDetails = true; " . "in LocalSettings.php to show detailed debugging information.\n";
     }
 }
开发者ID:paladox,项目名称:mediawiki,代码行数:12,代码来源:MWExceptionRenderer.php


注:本文中的MWExceptionHandler::getLogMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。