PMCORE-546

This commit is contained in:
Paulis
2019-08-09 14:27:53 -04:00
committed by Paula Quispe
parent 22197248dc
commit 4d5cabdc45
2 changed files with 226 additions and 4 deletions

View File

@@ -425,6 +425,9 @@ class MonologProvider
if (isset(static::$levels[$levelDebug])) {
$level = static::$levels[$levelDebug];
$this->levelDebug = $level;
} else {
//If is other value like NONE will set with empty level
$this->levelDebug = '';
}
}
@@ -467,7 +470,8 @@ class MonologProvider
}
/**
* Register log
* Register log if the level correspond to the logging_level defined
* In other way return false if the log was turn off or the actions does not logged
*
* @access public
*
@@ -475,12 +479,14 @@ class MonologProvider
* @param string $message The log message
* @param array $context The log context
*
* @return void
* @return bool
*/
public function addLog($level, $message, $context)
{
if (!empty($this->getLevelDebug())) {
$this->getLogger()->addRecord($level, $message, $context);
if (!empty($this->getLevelDebug()) && $level >= $this->getLevelDebug()) {
return $this->getLogger()->addRecord($level, $message, $context);
} else {
return false;
}
}
}