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 5f9b6aa commit 99c410f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
3 changes: 0 additions & 3 deletions src/Logger.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@ public function console(string $str, $category = null, $saveLog = true):?string
{
// TODO: Implement console() method.
$str = $this->logger->console($str,$category,$saveLog);
if(Config::getInstance()->getConf('CONSOLE.PUSH_LOG')){
ConsoleService::push($str);
}
return $str;
}

Expand Down
2 changes: 1 addition & 1 deletion src/SysConst.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

class SysConst
{
const EASYSWOOLE_VERSION = '3.1.9';
const EASYSWOOLE_VERSION = '3.1.10';
const LOGGER_HANDLER = 'LOGGER_HANDLER';
const ERROR_HANDLER = 'ERROR_HANDLER';
const TRIGGER_HANDLER = 'TRIGGER_HANDLER';
Expand Down
14 changes: 14 additions & 0 deletions src/Trigger.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ function __construct(TriggerInterface $trigger)
public function error($msg, int $errorCode = E_USER_ERROR, Location $location = null)
{
// TODO: Implement error() method.
if($location == null){
$location = $this->getLocation();
}
$this->trigger->error($msg,$errorCode,$location);
}

Expand All @@ -34,4 +37,15 @@ public function throwable(\Throwable $throwable)
// TODO: Implement throwable() method.
$this->trigger->throwable($throwable);
}

private function getLocation():Location
{
$location = new Location();
$debugTrace = debug_backtrace();
array_shift($debugTrace);
$caller = array_shift($debugTrace);
$location->setLine($caller['line']);
$location->setFile($caller['file']);
return $location;
}
}

0 comments on commit 99c410f

Please sign in to comment.