Debugging WordPress

Since I’m making use of WordPress for this blog I figured I’d spend some time debugging it and send in the patches. To assist in tracking down the bugs I made a small addition to wp-config.php:

function wp_error_handler(
) {
        "WordPress Error: " .
        "errno: {$errno} " .
        "errstr: {$errstr} " .
        "errfile: {$errfile} " .
        "errline: {$errline} " .

It isn’t the most elegant logging mechanism, but it does make errors show pretty obviously. Most of the errors that have come up so far are use of variables that doesn’t exist. I’d recommend NOT using this on a live site.