MantisBT

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000930XdebugFeature/Change requestpublic2013-03-03 18:022017-02-07 17:09
ReporterAddvilz 
Assigned Toderick 
PrioritylowSeveritymajorReproducibilityN/A
StatusresolvedResolutionwon't fix 
PlatformAnyOSAnyOS VersionAny
Product Version 
Target VersionFixed in Version 
Summary0000930: Feature to output errors to browser console
DescriptionI 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 InformationThis 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
Attached Files

- Relationships

-  Notes
(0003977)
derick (administrator)
2016-12-10 17:12

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?
(0004133)
derick (administrator)
2017-01-03 18:51

Ping?
(0004202)
derick (administrator)
2017-02-07 17:09

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


Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker