From 42c58220def38d5f762dc0c422012b0210577463 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Wed, 23 Oct 2013 10:47:26 +0200 Subject: Moved logException to OCP\Util class --- index.php | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) (limited to 'index.php') diff --git a/index.php b/index.php index 1b9b4a58f7f..ab7333cf0e6 100755 --- a/index.php +++ b/index.php @@ -23,34 +23,6 @@ $RUNTIME_NOAPPS = true; //no apps, yet -function logException($ex) { - $message = $ex->getMessage(); - if ($ex->getCode()) { - $message .= ' [' . $message . ']'; - } - \OCP\Util::writeLog('index', $message, \OCP\Util::FATAL); - if (defined('DEBUG') and DEBUG) { - // also log stack trace - $stack = explode('#', $ex->getTraceAsString()); - // first element is empty - array_shift($stack); - foreach ($stack as $s) { - \OCP\Util::writeLog('index', $s, \OCP\Util::FATAL); - } - - // include cause - $l = OC_L10N::get('lib'); - while (method_exists($ex, 'getPrevious') && $ex = $ex->getPrevious()) { - $message .= ' - '.$l->t('Caused by:').' '; - $message .= $ex->getMessage(); - if ($ex->getCode()) { - $message .= '['.$ex->getCode().'] '; - } - \OCP\Util::writeLog('index', $message, \OCP\Util::FATAL); - } - } -} - try { require_once 'lib/base.php'; @@ -58,7 +30,7 @@ try { OC::handleRequest(); } catch (Exception $ex) { - logException($ex); + \OCP\Util::logException($ex); //show the user a detailed error page OC_Response::setStatus(OC_Response::STATUS_INTERNAL_SERVER_ERROR); -- cgit v1.2.3