summaryrefslogtreecommitdiffstats
path: root/system/libraries
diff options
context:
space:
mode:
authorGreg Aker <greg.aker@ellislab.com>2010-12-21 18:44:08 +0100
committerGreg Aker <greg.aker@ellislab.com>2010-12-21 18:44:08 +0100
commit2eaa4074ea007cec58a802f591b4641b043213d1 (patch)
tree760887a7759177b1d58f97068bf74fe005fe5af0 /system/libraries
parent11eb2dcb181c4518d19646867e499c85d449208e (diff)
Moving system/{logs,cache} to the application directory.
Diffstat (limited to 'system/libraries')
-rw-r--r--system/libraries/Log.php19
1 files changed, 9 insertions, 10 deletions
diff --git a/system/libraries/Log.php b/system/libraries/Log.php
index 6d44cfa4b..cb160a934 100644
--- a/system/libraries/Log.php
+++ b/system/libraries/Log.php
@@ -26,11 +26,11 @@
*/
class CI_Log {
- var $log_path;
- var $_threshold = 1;
- var $_date_fmt = 'Y-m-d H:i:s';
- var $_enabled = TRUE;
- var $_levels = array('ERROR' => '1', 'DEBUG' => '2', 'INFO' => '3', 'ALL' => '4');
+ protected $_log_path;
+ protected $_threshold = 1;
+ protected $_date_fmt = 'Y-m-d H:i:s';
+ protected $_enabled = TRUE;
+ protected $_levels = array('ERROR' => '1', 'DEBUG' => '2', 'INFO' => '3', 'ALL' => '4');
/**
* Constructor
@@ -39,9 +39,9 @@ class CI_Log {
{
$config =& get_config();
- $this->log_path = ($config['log_path'] != '') ? $config['log_path'] : BASEPATH.'logs/';
+ $this->_log_path = ($config['log_path'] != '') ? $config['log_path'] : APPPATH.'logs/';
- if ( ! is_dir($this->log_path) OR ! is_really_writable($this->log_path))
+ if ( ! is_dir($this->_log_path) OR ! is_really_writable($this->_log_path))
{
$this->_enabled = FALSE;
}
@@ -64,13 +64,12 @@ class CI_Log {
*
* Generally this function will be called using the global log_message() function
*
- * @access public
* @param string the error level
* @param string the error message
* @param bool whether the error is a native PHP error
* @return bool
*/
- function write_log($level = 'error', $msg, $php_error = FALSE)
+ public function write_log($level = 'error', $msg, $php_error = FALSE)
{
if ($this->_enabled === FALSE)
{
@@ -84,7 +83,7 @@ class CI_Log {
return FALSE;
}
- $filepath = $this->log_path.'log-'.date('Y-m-d').EXT;
+ $filepath = $this->_log_path.'log-'.date('Y-m-d').EXT;
$message = '';
if ( ! file_exists($filepath))