Created
October 3, 2009 05:20
-
-
Save gnuget/200418 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
<?php | |
/** | |
* Magic Fields's debug Class | |
* | |
* @package Magic Fields | |
* @subpackage tools | |
*/ | |
class Debug{ | |
/** | |
* | |
* Writes logging info to a file. | |
* | |
* @var $string message | |
*/ | |
function log($msg,$path = "") { | |
if(empty($path)){ | |
$path = dirname(__FILE__)."/../tmp/debug/"; | |
} | |
if(!is_string($msg)){ | |
$msg = print_r($msg,true); | |
} | |
$fp = fopen($path.'magic_fields.log', 'a+'); | |
$date = gmdate( 'Y-m-d H:i:s' ); | |
fwrite($fp, "$date - $msg\n"); | |
fclose($fp); | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment