Handy for development, just call it up jdn_log_me( 'An issue' );
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Log any errors for debugging. | |
* | |
* @global WP_DEBUG | |
* @uses error_log | |
* @var string|array $message the error message (a string or array) | |
*/ | |
if( !function_exists( 'jdn_log_me' ) ) { | |
function jdn_log_me( $message ) { | |
if ( WP_DEBUG === true ) { | |
if ( is_array( $message ) || is_object( $message ) ) { | |
error_log( 'Custom Plugin Error: ' . print_r( $message, true ) ); | |
} else { | |
error_log( 'Custom Plugin Error: ' . $message ); | |
} | |
} | |
} | |
} |
Source: https://gist.github.com/joshuadavidnelson/b315bcd407b12cdb052f
Tags: debug