Created
January 31, 2015 16:17
-
-
Save joshuadavidnelson/b315bcd407b12cdb052f to your computer and use it in GitHub Desktop.
Log errors in WordPress
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 ); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment