Created
December 8, 2016 00:17
-
-
Save karlazz/aa6ddc582a35c74b95a290f899ba8304 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
//* add a trace file | |
$upload_dir = wp_upload_dir(); | |
define('TRACEFILE', $upload_dir['basedir'] . '/trace.log'); | |
function trace($log) { | |
$prefix = current_time( 'mysql' ) . ": " ; | |
$suffix = "\n" ; | |
if ( is_array( $log ) || is_object( $log ) ) { | |
error_log( $prefix, 3, TRACEFILE); | |
error_log( print_r( $log, true ) , 3, TRACEFILE ); | |
error_log( $suffix, 3, TRACEFILE ) ; | |
} | |
else { | |
error_log( $prefix . $log . $suffix, 3, TRACEFILE ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment