bobbingwide / oik-bwtrace

debug trace for WordPress
https://www.oik-plugins.com/oik-plugins/oik-bwtrace-debug-trace-for-wordpress/
GNU General Public License v2.0
6 stars 1 forks source link

Improve bw_trace_error_handler output #44

Closed bobbingwide closed 8 years ago

bobbingwide commented 8 years ago

Currently the output logged in the trace file doesn't exactly match what's seen in the browser when display errors is set. It would be nice if the $errstr were prepended by the appropriate Error level string. e.g. Warning: require_once( filename ): failed to open stream: No such file or directory

$errno constant string
1 E_ERROR Error
2 E_WARNING Warning
4 E_PARSE Parsing Error
8 E_NOTICE Notice
16 E_CORE_ERROR Core Error
32 E_CORE_WARNING Core Warning
64 E_COMPILE_ERROR Compile Error
128 E_COMPILE_WARNING Compile Warning
256 E_USER_ERROR User Error
512 E_USER_WARNING User Warning
1024 E_USER_NOTICE User Notice
2048 E_STRICT Runtime Notice
4096 E_RECOVERABLE_ERROR Catchable Fatal Error
8192 E_DEPRECATED Deprecated
16384 E_USER_DEPRECATED User Deprecated

See http://php.net/manual/en/errorfunc.constants.php and http://php.net/manual/en/errorfunc.examples.php

This would make it easier to find the trace records in the trace output file. Well, the one's that can be captured!