Skip to content

Instantly share code, notes, and snippets.

@kenanfallon
Created February 15, 2017 06:01
Show Gist options
  • Save kenanfallon/6c4dc429cc10342b80bc835c6de78e97 to your computer and use it in GitHub Desktop.
Save kenanfallon/6c4dc429cc10342b80bc835c6de78e97 to your computer and use it in GitHub Desktop.
WordPress write to debug.log
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 );
}
}
}
write_log( __LINE__ );
Credit: https://www.elegantthemes.com/blog/tips-tricks/using-the-wordpress-debug-log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment