[wp-hackers] debugging with print_r

Alex Günsche ag.ml2007 at zirona.com
Fri Sep 14 22:48:10 GMT 2007


On Fri, 2007-09-14 at 21:00 +0200, Ozh wrote:
> Don't know if it's because I'm dumb or something like this, but I find
> myself doing *a lot* of echo "<pre>";print_r($stuff);echo "</pre>";
> when coding something to check how things are doing.

When you need a logger for development, try WPsyslog:
http://www.zirona.com/software/wpsyslog-wordpress-syslog/

wherever you need to capture output, simply insert

<?php wpsyslog($mymodule, $logmessage, [$loglevel]); ?>

for example

<?php wpsyslog('foo', print_r($bar, true), 0); ?>

Alex

-- 
Alex Günsche, Zirona OpenSource-Consulting
Blogs: http://www.zirona.com/ | http://www.regularimpressions.net
PubKey for this address: http://www.zirona.com/misc/ag.ml2007.asc



More information about the wp-hackers mailing list