%s
Message: %s
File: %s
Line: %s ', $error_level, nl2br($error_message), $error_file, $error_line); switch ($error_level) { case E_ERROR: case E_CORE_ERROR: case E_COMPILE_ERROR: case E_PARSE: $color = '#f05050'; errorLogs($error, "Fatal", $color); break; case E_USER_ERROR: case E_RECOVERABLE_ERROR: $color = '#f05050'; errorLogs($error, "Error", $color); break; case E_WARNING: case E_CORE_WARNING: case E_COMPILE_WARNING: case E_USER_WARNING: $color = '#fad733'; errorLogs($error, "Warning", $color); break; case E_NOTICE: case E_USER_NOTICE: $color = '#23b7e5'; errorLogs($error, "Info", $color); break; case E_STRICT: $color = '#edf1f2'; errorLogs($error, "Debug", $color); break; default: $color = '#fad733'; errorLogs($error, "Warning", $color); } } function shutdownHandler() { $lasterror = error_get_last(); switch ($lasterror['type']) { case E_ERROR: case E_CORE_ERROR: case E_COMPILE_ERROR: case E_USER_ERROR: case E_RECOVERABLE_ERROR: case E_CORE_WARNING: case E_COMPILE_WARNING: case E_PARSE: $color = '#f05050'; $error = sprintf(' [SHUTDOWN] Lvl: %s
Message: %s
File: %s
Line: %s ', $lasterror['type'], nl2br($lasterror['message']), $lasterror['file'], $lasterror['line']); errorLogs($error, "Fatal", $color); } } function errorLogs($error, $errlvl, $color) { $render = '
' . $errlvl .'
' . $error . '
'; echo $render; } ?>