Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Simple debug trace to wp-content/debug.log
- *
- * @usage _log( $var );
- */
- if ( ! function_exists( '_log' ) ) {
- function _log( $log ) {
- if ( true == WP_DEBUG ) {
- if ( is_array( $log ) || is_object( $log ) ) {
- error_log( print_r( $log, true ) );
- } else {
- error_log( $log );
- }
- } else {
- ob_start();
- echo '[' . date('d-M-Y h:i:s T') . '] ';
- if ( is_array( $log ) || is_object( $log ) ) {
- print_r( $log );
- } else {
- echo( $log );
- }
- echo "\r\n";
- file_put_contents( ABSPATH . 'wp-content/debug.log', ob_get_contents(), FILE_APPEND );
- ob_end_clean();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement