Fix coding standard errors in Log/

This commit is contained in:
mark_story 2012-03-03 20:24:02 -05:00
parent 9d1e88ba13
commit dc2f6efe13
3 changed files with 19 additions and 15 deletions

View file

@ -18,24 +18,24 @@
* @since CakePHP(tm) v 0.2.9
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
/**
* Set up error level constants to be used within the framework if they are not defined within the
* system.
*
*/
if (!defined('LOG_WARNING')) {
define('LOG_WARNING', 3);
}
if (!defined('LOG_NOTICE')) {
define('LOG_NOTICE', 4);
}
if (!defined('LOG_DEBUG')) {
define('LOG_DEBUG', 5);
}
if (!defined('LOG_INFO')) {
define('LOG_INFO', 6);
}
if (!defined('LOG_WARNING')) {
define('LOG_WARNING', 3);
}
if (!defined('LOG_NOTICE')) {
define('LOG_NOTICE', 4);
}
if (!defined('LOG_DEBUG')) {
define('LOG_DEBUG', 5);
}
if (!defined('LOG_INFO')) {
define('LOG_INFO', 6);
}
/**
* Logs messages to configured Log adapters. One or more adapters can be configured
@ -205,4 +205,5 @@ class CakeLog {
}
return true;
}
}

View file

@ -24,6 +24,7 @@
* @package Cake.Log
*/
interface CakeLogInterface {
/**
* Write method to handle writes being made to the Logger
*
@ -32,4 +33,5 @@ interface CakeLogInterface {
* @return void
*/
public function write($type, $message);
}

View file

@ -59,7 +59,7 @@ class FileLog implements CakeLogInterface {
$debugTypes = array('notice', 'info', 'debug');
if ($type == 'error' || $type == 'warning') {
$filename = $this->_path . 'error.log';
$filename = $this->_path . 'error.log';
} elseif (in_array($type, $debugTypes)) {
$filename = $this->_path . 'debug.log';
} else {
@ -68,4 +68,5 @@ class FileLog implements CakeLogInterface {
$output = date('Y-m-d H:i:s') . ' ' . ucfirst($type) . ': ' . $message . "\n";
return file_put_contents($filename, $output, FILE_APPEND);
}
}