Fix log controller

This commit is contained in:
Alexander Pankratov 2023-04-11 01:57:10 +02:00
parent 8ab0dbd8cd
commit c2d355eb07

View File

@ -3,6 +3,7 @@
namespace TelegramApiServer\EventObservers;
use TelegramApiServer\Logger;
use Throwable;
class LogObserver
{
@ -22,9 +23,9 @@ class LogObserver
public static function log($message, int $level)
{
if (is_scalar($message)) {
Logger::getInstance()->log(Logger::$madelineLevels[$level], (string) $message);
Logger::getInstance()->log(Logger::$madelineLevels[$level], (string)$message);
} else {
if ($message instanceof \Throwable) {
if ($message instanceof Throwable) {
$message = Logger::getExceptionAsArray($message);
}
if (is_array($message)) {