Skip to content

Commit

Permalink
Fixed Logger::log() function for support configuration parameters on …
Browse files Browse the repository at this point in the history
…calling.
  • Loading branch information
Isidro A. López G committed Sep 21, 2020
1 parent 016e71e commit 17058eb
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/Services/Logger.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,15 +195,16 @@ public function write($level, $message) {
/**
* Log a message into the default log system. If the log system does not exists, will create a new one.
*
* @param int $level log message level. Accepts: `debug`, `error`, `info` and `warning` messages.
* @param string $message log message.
* @param int $level log message level. Accepts: `debug`, `error`, `info` and `warning` messages.
* @param string $message log message.
* @param array $params configuration parameters, if any.
*
* @return bool <code>true</code> if line was successfully wrote, <code>false</code> otherwise.
*/
public static function log($level, $message) {
public static function log($level, $message, $params = []) {
static $logger;
if (!($logger instanceof Logger)) {
$logger = new Logger();
$logger = new Logger($params);
}

return $logger->write($level, $message);
Expand Down

0 comments on commit 17058eb

Please sign in to comment.