diff options
author | Andrey Andreev <narf@devilix.net> | 2014-01-15 16:51:58 +0100 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2014-01-15 16:51:58 +0100 |
commit | 60f71be48a6b91cc314908c3c0007f13e9cb2f0a (patch) | |
tree | c7eb0d43c976984303886503781e0fcae0f0949a /system/core/Log.php | |
parent | 9916bfc126b0d6efa337740b263f123c5367fc55 (diff) | |
parent | d8b1ad31cf7ee205ddf3cf396b1d1bfa45af49fa (diff) |
Merge changes from develop
Diffstat (limited to 'system/core/Log.php')
-rw-r--r-- | system/core/Log.php | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/system/core/Log.php b/system/core/Log.php index b2327b8f0..63fef2088 100644 --- a/system/core/Log.php +++ b/system/core/Log.php @@ -175,10 +175,18 @@ class CI_Log { return FALSE; } - $message .= $level.' '.($level === 'INFO' ? ' -' : '-').' '.date($this->_date_fmt).' --> '.$msg."\n"; + $message .= $level.' - '.date($this->_date_fmt).' --> '.$msg."\n"; flock($fp, LOCK_EX); - fwrite($fp, $message); + + for ($written = 0, $length = strlen($message); $written < $length; $written += $result) + { + if (($result = fwrite($fp, substr($message, $written))) === FALSE) + { + break; + } + } + flock($fp, LOCK_UN); fclose($fp); @@ -187,7 +195,7 @@ class CI_Log { @chmod($filepath, FILE_WRITE_MODE); } - return TRUE; + return is_int($result); } } |