mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-30 23:29:54 +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();
|
$trace = $e->getTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
$message = self::printExceptionMessage($e);
|
$this->synchronized(function() use ($e, $trace) : void{
|
||||||
$stack = Utils::printableTrace($trace);
|
$this->critical(self::printExceptionMessage($e));
|
||||||
|
foreach(Utils::printableTrace($trace) as $line){
|
||||||
$this->synchronized(function() use ($message, $stack) : void{
|
|
||||||
$this->critical($message);
|
|
||||||
foreach($stack as $line){
|
|
||||||
$this->debug($line, true);
|
$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();
|
$this->syncFlushBuffer();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user