Skip to content

Commit

Permalink
3.1.10
Browse files Browse the repository at this point in the history
  • Loading branch information
kiss291323003 committed Jan 15, 2019
1 parent c0d6849 commit ba45f9d
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/Logger.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,34 +24,40 @@ 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);
}
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);
}
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();
Expand Down

0 comments on commit ba45f9d

Please sign in to comment.