mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
Core/ErrorHandler
* do not handle errors outside of the registered handlers * always handle all errors otherwise they get stored for error_get_last * always print errors to CLI * shutdown function handler should not be picky about what errors it gets to report * removed some mostly unused error strings
This commit is contained in:
@@ -309,6 +309,20 @@ abstract class CLI
|
||||
flush();
|
||||
}
|
||||
|
||||
public static function logLevelFromE(int $phpError) : int
|
||||
{
|
||||
if ($phpError & (E_ERROR | E_PARSE | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERROR | E_RECOVERABLE_ERROR))
|
||||
return self::LOG_ERROR;
|
||||
|
||||
if ($phpError & (E_WARNING | E_USER_WARNING | E_NOTICE | E_USER_NOTICE | E_CORE_WARNING | E_COMPILE_WARNING))
|
||||
return self::LOG_WARN;
|
||||
|
||||
if ($phpError & (E_STRICT | E_NOTICE | E_USER_NOTICE | E_DEPRECATED | E_USER_DEPRECATED))
|
||||
return self::LOG_INFO;
|
||||
|
||||
return self::LOG_BLANK;
|
||||
}
|
||||
|
||||
private static function purgeEscapes(string $msg) : string
|
||||
{
|
||||
return preg_replace(["/\e\[[\d;]+[mK]/", "/\e\[\d+G/"], ['', "\n"], $msg);
|
||||
|
||||
Reference in New Issue
Block a user