Last active
August 29, 2015 14:12
-
-
Save theMikeD/589f0065f7d9785c4f20 to your computer and use it in GitHub Desktop.
More flexible replacement for error_log()
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
<?php | |
//---------------------------------------------------------------------------------------- | |
// print to the log, either a variable, object or array | |
function md_log ( $o ){ | |
$callers=debug_backtrace(); | |
error_log ($callers[1]['function']); | |
if ( is_array( $o ) || is_object( $o ) ) { | |
error_log(print_r( $o, true)); | |
} else { | |
error_log( $o ); | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Can't get the language formatting to stick, so you're stuck with txt.