Created
September 4, 2015 17:48
-
-
Save tylerdigital/a02d200bbc93d60b10e6 to your computer and use it in GitHub Desktop.
This file contains 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
function td_debug_log($sMsg = NULL) { | |
if (!is_string($sMsg)) $sMsg = print_r($sMsg, true); | |
$sFile = dirname(__FILE__) . '/~log.txt'; | |
$fh = fopen($sFile, 'a+'); | |
if ($fh !== FALSE) | |
{ | |
if ($sMsg === NULL) | |
fwrite($fh, date("\r\nY-m-d H:I:s:\r\n")); | |
else | |
fwrite($fh, date('Y-m-d H:i:s - ') . $sMsg . "\r\n"); | |
fclose($fh); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment