joey-pie
7/5/2016 - 9:59 AM

Log errors to Wordpress debug.log

Log errors to Wordpress debug.log

if ( ! function_exists( 'jpg_write_error_to_log' ) ) {
   function jpg_write_error_to_log ( $log )  {
      if ( is_array( $log ) || is_object( $log ) ) {
         error_log( print_r( $log, true ) );
      } else {
         error_log( $log );
      }
   }
}