[wp-trac] [WordPress Trac] #19589: Simplify the recording of backtraces

WordPress Trac wp-trac at lists.automattic.com
Tue Jan 24 17:45:46 UTC 2012


#19589: Simplify the recording of backtraces
------------------------------+--------------------
 Reporter:  westi             |       Owner:  westi
     Type:  defect (bug)      |      Status:  new
 Priority:  normal            |   Milestone:  3.4
Component:  Warnings/Notices  |     Version:  3.3
 Severity:  normal            |  Resolution:
 Keywords:  early has-patch   |
------------------------------+--------------------

Comment (by westi):

 Replying to [comment:4 nacin]:
 > I think it would be better for the function to return an array that can
 then be imploded. For example someone may wish to turn this into a list,
 or reverse it first, before printing it. The comma is a bit hard-coded in.
 >
 > Beyond that, +1.

 I specifically avoided returning the array for a number of reasons:
  * I was trying to refactor the code out of WPDB and make it more
 generally usable so wanted it to be a drop-in replacement in terms of
 functionality
  * I wanted to encourage consistent display and ordering of the data
 across use-cases - so that you can look at the displayed trace and see it
 exactly.
  * When you display the backtrace not imploded you want to display more
 info like line numbers now you have the space for them

 However, I can see that adding a 3rd argument {{{$pretty}}} which defaults
 to true and current behaviour and otherwise returns the array if false is
 a simple and clean thing to do so I'm not averse to doing it and will
 include it.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/19589#comment:5>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list