View Issue Details

IDProjectCategoryView StatusLast Update
0000930XdebugStep Debuggingpublic2020-03-12 16:59
ReporterAddvilz Assigned Toderick  
PrioritylowSeverityfeatureReproducibilityN/A
Status resolvedResolutionwon't fix 
PlatformAnyOSAnyOS VersionAny
Summary0000930: Feature to output errors to browser console
Description

I am suggesting a feature where instead of direct html error output JavaScript based output could be used to log all errors to browser console, as an configurable option. This could be done by adding new format to xdebug_stack.c which would then be used if some configuration variable would be set. I have already done this by simply modifying html_formats and it works great as far as I have tested it. Consider the attached code.

Additional Information

This code is probably broken, but it will serve us demonstration purpose quite well, i suppose.

static char jscript_formats[11] = {
"<script>xdebug = new Object();\n",
"xdebug.message = '%s: %s in %s on line %d';\n",
"xdebug.stack = new Array();\nstatic char
jscript_formats[11] = {
"<script>xdebug = new Object();\n",
"xdebug.message = '%s: %s in %s on line %d';\n",
"xdebug.stack = new Array();\n",
#if HAVE_PHP_MEMORY_USAGE
"xdebug.stack.push(\"%10.4f %10ld %3d. %s",
#else
"xdebug.stack.push(\"%10.4f %3d. %s",
#endif
"'%s'",
" %s:%d\");\n\n",
"\n\nVariables in local scope (#%d):\n",
"if (typeof window.xdebuglog === 'undefined'){ console.log(xdebug); }else{ window.xdebuglog(xdebug); }</script>\n",
" $%s = %s",
" $%s = uninitialized\n",
"SCREAM: Error suppression ignored for\n"
};",
#if HAVE_PHP_MEMORY_USAGE
"xdebug.stack.push(\"%10.4f %10ld %3d. %s",
#else
"xdebug.stack.push(\"%10.4f %3d. %s",
#endif
"'%s'",
" %s:%d\");\n\n",
"\n\nVariables in local scope (#%d):\n",
"console.log(xdebug);</script>\n",
" $%s = %s",
" $%s = uninitialized\n",
"SCREAM: Error suppression ignored for\n"
};

TagsNo tags attached.
Operating System
PHP Version5.4.0

Activities

derick

2016-12-10 17:12

administrator   ~0003977

How is this going to work if we are in a different context than a normal HTML tag - say an HTML attribute?

<p class="<script...>"> isn't really valid?

derick

2017-01-03 18:51

administrator   ~0004133

Ping?

derick

2017-02-07 17:09

administrator   ~0004202

I am closing this, as the requested feedback has not been given. Please feel free to reopen this if you can provide more information as requested.

Issue History

Date Modified Username Field Change
2013-03-03 18:02 Addvilz New Issue
2016-12-10 17:12 derick Note Added: 0003977
2016-12-10 17:12 derick Assigned To => derick
2016-12-10 17:12 derick Status new => feedback
2017-01-03 18:51 derick Note Added: 0004133
2017-02-07 17:09 derick Note Added: 0004202
2017-02-07 17:09 derick Status feedback => resolved
2017-02-07 17:09 derick Resolution open => won't fix
2020-03-12 16:55 derick Severity major => feature
2020-03-12 16:59 derick Category Feature/Change request => Step Debugging