Loglevel is an int

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
Roeland Jago Douma 2018-02-27 10:45:35 +01:00
parent 83eb548d23
commit 6994bce951
No known key found for this signature in database
GPG Key ID: F941078878347C0C
4 changed files with 6 additions and 6 deletions

View File

@ -41,7 +41,7 @@ class TestLogger extends Log {
//disable original constructor //disable original constructor
} }
public function log($level, string $message, array $context = array()) { public function log(int $level, string $message, array $context = array()) {
$this->level = $level; $this->level = $level;
$this->message = $message; $this->message = $message;
} }

View File

@ -245,12 +245,12 @@ class Log implements ILogger {
/** /**
* Logs with an arbitrary level. * Logs with an arbitrary level.
* *
* @param mixed $level * @param int $level
* @param string $message * @param string $message
* @param array $context * @param array $context
* @return void * @return void
*/ */
public function log($level, string $message, array $context = []) { public function log(int $level, string $message, array $context = []) {
$minLevel = min($this->config->getValue('loglevel', Util::WARN), Util::FATAL); $minLevel = min($this->config->getValue('loglevel', Util::WARN), Util::FATAL);
$logCondition = $this->config->getValue('log.condition', []); $logCondition = $this->config->getValue('log.condition', []);

View File

@ -120,13 +120,13 @@ interface ILogger {
/** /**
* Logs with an arbitrary level. * Logs with an arbitrary level.
* *
* @param mixed $level * @param int $level
* @param string $message * @param string $message
* @param array $context * @param array $context
* @return mixed * @return mixed
* @since 7.0.0 * @since 7.0.0
*/ */
public function log($level, string $message, array $context = []); public function log(int $level, string $message, array $context = []);
/** /**
* Logs an exception very detailed * Logs an exception very detailed

View File

@ -17,7 +17,7 @@ class NullLogger extends Log {
//disable original constructor //disable original constructor
} }
public function log($level, string $message, array $context = array()) { public function log(int $level, string $message, array $context = array()) {
//noop //noop
} }
} }