Trimming comment bloat in Log class.
This commit is contained in:
parent
5643daa66c
commit
5114f2ee87
|
@ -44,20 +44,13 @@ public static function error($message)
|
||||||
*/
|
*/
|
||||||
public static function write($type, $message)
|
public static function write($type, $message)
|
||||||
{
|
{
|
||||||
// -----------------------------------------------------
|
|
||||||
// Create the yearly and monthly directories if needed.
|
// Create the yearly and monthly directories if needed.
|
||||||
// -----------------------------------------------------
|
|
||||||
static::make_directory($directory = APP_PATH.'storage/logs/'.date('Y'));
|
static::make_directory($directory = APP_PATH.'storage/logs/'.date('Y'));
|
||||||
static::make_directory($directory .= '/'.date('m'));
|
static::make_directory($directory .= '/'.date('m'));
|
||||||
|
|
||||||
// -----------------------------------------------------
|
// Get the daily log file filename.
|
||||||
// Each day has its own log file.
|
|
||||||
// -----------------------------------------------------
|
|
||||||
$file = $directory.'/'.date('d').EXT;
|
$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);
|
file_put_contents($file, date('Y-m-d H:i:s').' '.$type.' - '.$message.PHP_EOL, LOCK_EX | FILE_APPEND);
|
||||||
|
|
||||||
chmod($file, 0666);
|
chmod($file, 0666);
|
||||||
|
|
Loading…
Reference in New Issue