Created
November 21, 2019 23:11
-
-
Save coulterpeterson/d6599793b6937dba1a15d00df0e80957 to your computer and use it in GitHub Desktop.
#WordPress Debugging Enable and Logging Function
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
// Source: https://www.elegantthemes.com/blog/tips-tricks/using-the-wordpress-debug-log | |
// Usage example: write_log('The variable value is: ' . $myVariable); | |
if ( ! function_exists('write_log')) { | |
function write_log ( $log ) { | |
if ( is_array( $log ) || is_object( $log ) ) { | |
error_log( print_r( $log, true ) ); | |
} else { | |
error_log( $log ); | |
} | |
} | |
} |
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
define( 'WP_DEBUG', true ); | |
define( 'WP_DEBUG_LOG', true ); | |
define( 'WP_DEBUG_DISPLAY', false ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment