Last active
March 7, 2018 21:12
-
-
Save lstanard/dee741641b63b63dc695ea55eebab0a5 to your computer and use it in GitHub Desktop.
WordPress plugin to write debug_log to debug.log file
This file contains hidden or 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 | |
/* | |
Plugin Name: Simple Debug Log | |
*/ | |
if ( ! function_exists('debug_log')) { | |
function debug_log ( $log ) { | |
if ( is_array( $log ) || is_object( $log ) ) { | |
error_log( print_r( $log, true ) ); | |
} else { | |
error_log( $log ); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment