Created
March 31, 2015 16:51
-
-
Save r-a-y/12daf886b98293b357e7 to your computer and use it in GitHub Desktop.
Debug log function for WordPress. Put this in /wp-content/mu-plugins/.
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 | |
function ray_log( $message ) { | |
if ( empty( $message ) ) | |
return; | |
error_log( '[' . gmdate( 'd-M-Y H:i:s' ) . '] ' . $message . "\n", 3, WP_CONTENT_DIR . '/ray.log' ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment