removed backtrace code from debug notice (replaced by error backtrace)

This commit is contained in:
Steffen Schröder 2014-03-19 14:23:43 +01:00
parent 4d5280ce8f
commit 06907825ed
2 changed files with 4 additions and 5 deletions

View File

@ -38,6 +38,7 @@ class ErrorHandler {
* @param \Exception $ex
*/
public function exceptionHandler(\Exception $ex) {
// Log exception
$message = "[ManiaControl EXCEPTION]: {$ex->getMessage()}";
$traceMessage = 'Class: ' . get_class($ex) . PHP_EOL;
$traceMessage .= 'Trace:' . PHP_EOL . $ex->getTraceAsString();
@ -95,7 +96,7 @@ class ErrorHandler {
* @param $errorLine
* @return bool
*/
public function errorHandler($errorNumber, $errorString, $errorFile, $errorLine) {
public function errorHandler($errorNumber, $errorString, $errorFile = null, $errorLine = -1) {
if (error_reporting() == 0) {
// Error suppressed
return false;
@ -159,9 +160,7 @@ class ErrorHandler {
* @param $message
*/
public function triggerDebugNotice($message) {
$backtrace = debug_backtrace();
$callee = array_shift($backtrace);
$this->errorHandler(self::MC_DEBUG_NOTICE, $message, $callee['file'], $callee['line']);
$this->errorHandler(self::MC_DEBUG_NOTICE, $message);
}
/**

View File

@ -91,7 +91,7 @@ class ManiaControl implements CommandListener, TimerListener {
public function __construct() {
//Construct Error Handler
$this->errorHandler = new ErrorHandler($this);
$this->log('Loading ManiaControl v' . self::VERSION . '...');
// Load config