Trimming comment bloat in Log class.

This commit is contained in:
Taylor Otwell 2011-07-06 14:49:18 -07:00
parent 5643daa66c
commit 5114f2ee87
1 changed files with 1 additions and 8 deletions

View File

@ -44,20 +44,13 @@ public static function error($message)
*/
public static function write($type, $message)
{
// -----------------------------------------------------
// Create the yearly and monthly directories if needed.
// -----------------------------------------------------
static::make_directory($directory = APP_PATH.'storage/logs/'.date('Y'));
static::make_directory($directory .= '/'.date('m'));
// -----------------------------------------------------
// Each day has its own log file.
// -----------------------------------------------------
// Get the daily log file filename.
$file = $directory.'/'.date('d').EXT;
// -----------------------------------------------------
// Append to the log file and set the permissions.
// -----------------------------------------------------
file_put_contents($file, date('Y-m-d H:i:s').' '.$type.' - '.$message.PHP_EOL, LOCK_EX | FILE_APPEND);
chmod($file, 0666);