Merge pull request #2518 from dhensby/patch-1

Appending to debug.log file
This commit is contained in:
Ingo Schommer 2013-10-10 03:09:27 -07:00
commit 691f1a3056

View File

@ -205,11 +205,16 @@ class Debug {
* @param $message string to output
*/
public static function log($message) {
$file = dirname(__FILE__).'/../../debug.log';
if (defined('BASE_PATH')) {
$path = BASE_PATH;
}
else {
$path = dirname(__FILE__) . '/../..';
}
$file = $path . '/debug.log';
$now = date('r');
$oldcontent = (file_exists($file)) ? file_get_contents($file) : '';
$content = $oldcontent . "\n\n== $now ==\n$message\n";
file_put_contents($file, $content);
$content = "\n\n== $now ==\n$message\n";
file_put_contents($file, $content, FILE_APPEND);
}
/**