Skip to content

Instantly share code, notes, and snippets.

@lstanard
Last active March 7, 2018 21:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lstanard/dee741641b63b63dc695ea55eebab0a5 to your computer and use it in GitHub Desktop.
Save lstanard/dee741641b63b63dc695ea55eebab0a5 to your computer and use it in GitHub Desktop.
WordPress plugin to write debug_log to debug.log file
<?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