From 2eaa4074ea007cec58a802f591b4641b043213d1 Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Tue, 21 Dec 2010 11:44:08 -0600 Subject: Moving system/{logs,cache} to the application directory. --- system/libraries/Log.php | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'system/libraries') 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)) -- cgit v1.2.3-24-g4f1b