diff --git a/src/Logger.php b/src/Logger.php index cb06ae7e..973faddf 100644 --- a/src/Logger.php +++ b/src/Logger.php @@ -24,9 +24,12 @@ function __construct(LoggerInterface $logger) $this->logger = $logger; } - public function log(string $str, $logCategory = 'default', int $timestamp = null):?string + public function log(string $str, $logCategory = null, int $timestamp = null):?string { // TODO: Implement log() method. + if($logCategory == null){ + $logCategory = 'default'; + } $str = $this->logger->log($str,$logCategory,$timestamp); if(Config::getInstance()->getConf('CONSOLE.PUSH_LOG')){ ConsoleService::push($str); @@ -34,16 +37,19 @@ public function log(string $str, $logCategory = 'default', int $timestamp = null return $str; } - public function logWithLocation(string $str,$logCategory = 'default',int $timestamp = null):?string + public function logWithLocation(string $str,$logCategory = null,int $timestamp = null):?string { $location = $this->getLocation(); $str = "[file:{$location->getFile()}][line:{$location->getLine()}]{$str}"; return $this->log($str,$logCategory); } - public function console(string $str, $category = 'console', $saveLog = true):?string + public function console(string $str, $category = null, $saveLog = true):?string { // TODO: Implement console() method. + if($category == null){ + $category = 'default'; + } $final = $this->logger->console($str,$category,false); if($saveLog){ $this->log($str,$category); @@ -51,7 +57,7 @@ public function console(string $str, $category = 'console', $saveLog = true):?st return $final; } - public function consoleWithLocation(string $str, $category = 'console', $saveLog = true):?string + public function consoleWithLocation(string $str, $category = null, $saveLog = true):?string { // TODO: Implement console() method. $location = $this->getLocation();