diff --git a/src/Logging/Message.php b/src/Logging/Message.php index 8759ce4..2c4f953 100644 --- a/src/Logging/Message.php +++ b/src/Logging/Message.php @@ -5,6 +5,7 @@ namespace Fykosak\Utils\Logging; use Nette\SmartObject; +use Nette\Utils\Html; class Message { @@ -16,10 +17,10 @@ class Message public const LVL_INFO = 'info'; public const LVL_PRIMARY = 'primary'; - public string $text; + public Html|string $text; public string $level; - public function __construct(string $message, string $level) + public function __construct(Html|string $message, string $level) { $this->text = $message; $this->level = $level; @@ -31,7 +32,7 @@ public function __construct(string $message, string $level) public function __toArray(): array { return [ - 'text' => $this->text, + 'text' => ($this->text instanceof Html) ? $this->text->toHtml() : $this->text, 'level' => $this->level, ]; }