mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-20 16:00:20 +00:00
MainLogger: log exception chains in logException(), closes #2447
this method is simpler than #2447 and easier to apply to stable.
This commit is contained in:
parent
c4580dd56d
commit
0a39e580e9
@ -205,14 +205,17 @@ class MainLogger extends \AttachableThreadedLogger{
|
||||
$trace = $e->getTrace();
|
||||
}
|
||||
|
||||
$message = self::printExceptionMessage($e);
|
||||
$stack = Utils::printableTrace($trace);
|
||||
|
||||
$this->synchronized(function() use ($message, $stack) : void{
|
||||
$this->critical($message);
|
||||
foreach($stack as $line){
|
||||
$this->synchronized(function() use ($e, $trace) : void{
|
||||
$this->critical(self::printExceptionMessage($e));
|
||||
foreach(Utils::printableTrace($trace) as $line){
|
||||
$this->debug($line, true);
|
||||
}
|
||||
for($prev = $e->getPrevious(); $prev !== null; $prev = $prev->getPrevious()){
|
||||
$this->debug("Previous: " . self::printExceptionMessage($prev), true);
|
||||
foreach(Utils::printableTrace($prev->getTrace()) as $line){
|
||||
$this->debug(" " . $line, true);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$this->syncFlushBuffer();
|
||||
|
Loading…
x
Reference in New Issue
Block a user