mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Fix coding standard errors in Log/
This commit is contained in:
parent
9d1e88ba13
commit
dc2f6efe13
3 changed files with 19 additions and 15 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
||||
}
|
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue