mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-18 09:24:05 +00:00
MainLogger: Always use CRITICAL for logException()
This commit is contained in:
parent
f638845ef6
commit
1fd4077907
@ -36,10 +36,6 @@ use function sprintf;
|
|||||||
use function time;
|
use function time;
|
||||||
use function touch;
|
use function touch;
|
||||||
use function trim;
|
use function trim;
|
||||||
use const E_ERROR;
|
|
||||||
use const E_USER_ERROR;
|
|
||||||
use const E_USER_WARNING;
|
|
||||||
use const E_WARNING;
|
|
||||||
use const PHP_EOL;
|
use const PHP_EOL;
|
||||||
use const PTHREADS_INHERIT_NONE;
|
use const PTHREADS_INHERIT_NONE;
|
||||||
|
|
||||||
@ -198,11 +194,6 @@ class MainLogger extends \AttachableThreadedLogger{
|
|||||||
$errno = $e->getCode();
|
$errno = $e->getCode();
|
||||||
$errline = $e->getLine();
|
$errline = $e->getLine();
|
||||||
|
|
||||||
if($errno === 0){
|
|
||||||
$type = LogLevel::CRITICAL;
|
|
||||||
}else{
|
|
||||||
$type = ($errno === E_ERROR or $errno === E_USER_ERROR) ? LogLevel::ERROR : (($errno === E_USER_WARNING or $errno === E_WARNING) ? LogLevel::WARNING : LogLevel::NOTICE);
|
|
||||||
}
|
|
||||||
try{
|
try{
|
||||||
$errno = \ErrorUtils::errorTypeToString($errno);
|
$errno = \ErrorUtils::errorTypeToString($errno);
|
||||||
}catch(\InvalidArgumentException $e){
|
}catch(\InvalidArgumentException $e){
|
||||||
@ -214,8 +205,8 @@ class MainLogger extends \AttachableThreadedLogger{
|
|||||||
$message = get_class($e) . ": \"$errstr\" ($errno) in \"$errfile\" at line $errline";
|
$message = get_class($e) . ": \"$errstr\" ($errno) in \"$errfile\" at line $errline";
|
||||||
$stack = Utils::printableTrace($trace);
|
$stack = Utils::printableTrace($trace);
|
||||||
|
|
||||||
$this->synchronized(function() use ($type, $message, $stack) : void{
|
$this->synchronized(function() use ($message, $stack) : void{
|
||||||
$this->log($type, $message);
|
$this->log(LogLevel::CRITICAL, $message);
|
||||||
foreach($stack as $line){
|
foreach($stack as $line){
|
||||||
$this->debug($line, true);
|
$this->debug($line, true);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user