From 43a1cd99b09c01f2ed1b6dc1a395d10c8883e5bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20Schro=CC=88der?= Date: Sat, 3 May 2014 22:54:42 +0200 Subject: [PATCH] added FileLine to error report --- application/ManiaControl.php | 6 +++--- application/core/ErrorHandler.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/application/ManiaControl.php b/application/ManiaControl.php index 97ae7943..18a2e080 100644 --- a/application/ManiaControl.php +++ b/application/ManiaControl.php @@ -22,8 +22,8 @@ if (function_exists('date_default_timezone_get') && function_exists('date_defaul // Build log file name $logFileName = ManiaControlDir . 'logs' . DIRECTORY_SEPARATOR; -if (!is_dir($logFileName)) { - mkdir($logFileName); +if (!is_dir($logFileName) && !mkdir($logFileName)) { + echo "Couldn't create Logs Folder, please check the File Permissions!"; } $logFileName .= 'ManiaControl'; if (LOG_NAME_USE_DATE) { @@ -105,7 +105,7 @@ spl_autoload_register(function ($className) { } // Plugin file - $filePath = ManiaControlDir . 'plugins'.DIRECTORY_SEPARATOR . $classPath . '.php'; + $filePath = ManiaControlDir . 'plugins' . DIRECTORY_SEPARATOR . $classPath . '.php'; if (file_exists($filePath)) { require_once $filePath; return; diff --git a/application/core/ErrorHandler.php b/application/core/ErrorHandler.php index a2d4bf24..de328814 100644 --- a/application/core/ErrorHandler.php +++ b/application/core/ErrorHandler.php @@ -136,7 +136,7 @@ class ErrorHandler { $message = $errorTag . ': ' . $errorString; $fileLine = $errorFile . ': ' . $errorLine; $traceMessage = $this->parseBackTrace(debug_backtrace()); - $logMessage = $message . PHP_EOL . ($userError ? $fileLine : $traceMessage); + $logMessage = $message . PHP_EOL . $fileLine . PHP_EOL . $traceMessage; logMessage($logMessage); if ($this->reportErrors && !$userError) {