// Norm
This commit is contained in:
@@ -29,9 +29,9 @@ abstract class AbstractLoggerCore
|
|||||||
{
|
{
|
||||||
public $level;
|
public $level;
|
||||||
protected $level_value = array(0 => 'DEBUG',
|
protected $level_value = array(0 => 'DEBUG',
|
||||||
1 => 'INFO',
|
1 => 'INFO',
|
||||||
2 => 'WARNING',
|
2 => 'WARNING',
|
||||||
3 => 'ERROR');
|
3 => 'ERROR');
|
||||||
|
|
||||||
const DEBUG = 0;
|
const DEBUG = 0;
|
||||||
const INFO = 1;
|
const INFO = 1;
|
||||||
@@ -55,17 +55,15 @@ abstract class AbstractLoggerCore
|
|||||||
abstract protected function logMessage($message, $level);
|
abstract protected function logMessage($message, $level);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check the level and log the message if needed
|
* Check the level and log the message if needed
|
||||||
*
|
*
|
||||||
* @param string message
|
* @param string message
|
||||||
* @param level
|
* @param level
|
||||||
*/
|
*/
|
||||||
public function log($message, $level = self::DEBUG)
|
public function log($message, $level = self::DEBUG)
|
||||||
{
|
{
|
||||||
if ($level >= $this->level)
|
if ($level >= $this->level)
|
||||||
{
|
|
||||||
$this->logMessage($message, $level);
|
$this->logMessage($message, $level);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user