summaryrefslogtreecommitdiffstats
path: root/system/libraries/Log.php
diff options
context:
space:
mode:
Diffstat (limited to 'system/libraries/Log.php')
-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))