[wp-trac] [WordPress Trac] #33740: Create a new API to standardize application tracing

WordPress Trac noreply at wordpress.org
Fri Oct 21 09:13:46 UTC 2016


#33740: Create a new API to standardize application tracing
-------------------------------+------------------------------
 Reporter:  bobbingwide        |       Owner:
     Type:  feature request    |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Bootstrap/Load     |     Version:  4.4
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------

Comment (by bobbingwide):

 Hi, the main differences between the APIs I'm proposing and the standard
 PHP logic are:

 - ability to control when the output is produced - easily turn on / off
 the functionality
 - output does not affect what the end user sees
 - ability to provide lots of contextual information

 The similarities are:

 - API always available


 In my oik-bwtrace plugin I have basically delivered two APIs: trace and
 backtrace

 A simple call to the trace routine ( bw_trace2 ) will produce a lot more
 information than var_dump or print_r, will do it consistently and should
 be more robust.

 The ''lazy_'' versions of the APIs are pluggable, so they can be
 implemented in a variety of ways.

 Whether or not core makes use of the APIs itself is a difficult question
 to answer.
 When debugging a problem I often resort to adding trace and backtrace
 calls in my local copy.
 More often and not they don't need to be permanent. The important thing is
 that they're easy to use and provide useful information.

 The ''lazy_'' versions of the APIs are pluggable, so they can be
 implemented in a variety of ways.
 In my oik-bwtrace plugin ( https://wordpress.org/plugins/oik-bwtrace/ )
 I've built a whole host of functionality to support advanced debugging and
 tracing of logic.

 But everything is dependent on the initial dormant APIs.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/33740#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list