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

Disable "SERVER" trace #72

Closed bobbingwide closed 4 years ago

bobbingwide commented 6 years ago

Requirements

Control what's traced at trace startup. Specifically, disable "SERVER" trace.

Notes

In trace_startup some of the calls to bw_lazy_trace do not check the required trace level; they are issued as BW_TRACE_ALWAYS.

Proposed solution

Short term

Test for Information level

if ( $bw_trace_level >= BW_TRACE_INFO ) { 
   bw_lazy_trace( $_SERVER, __FUNCTION__, __LINE__, __FILE__, "_SERVER" );
   bw_lazy_trace( $_REQUEST, __FUNCTION__, __LINE__, __FILE__, "_REQUEST" );
}

Longer term

Provide UI to allow control of the data displayed at start up. Note: This could include tracing the HTTP_RAW_POST_DATA ( See bw_trace_http_raw_post_data()).

bobbingwide commented 4 years ago

It's not going to be easy to test using PHPUnit. It is easy to test by just using it. I'm going to remove the logic that traces the value of trace_options['file'] value and add logic to trace $this->trace_options and $this->trace_files_options if tracing is VERBOSE.

bobbingwide commented 4 years ago

Trace levels are documented in https://www.oik-plugins.com/wordpress-plugins-from-oik-plugins/free-oik-plugins/oik-trace-plugin/settings-oik-trace-options/trace-options-trace-records/

bobbingwide commented 4 years ago

Which globals are traced for a particular trace level is documented in: https://www.oik-plugins.com/oik-faq/how-do-i-trace-globals/