protected function convertMessageToString($message) {
        $messageStr = $message;
        if ($message === null) {
            $messageStr = 'NULL';
        } elseif ($message instanceof \Throwable) {
            $messageStr = $this->convertErrorToString($message);
        } elseif (is_bool($message)) {
            $messageStr = $message ? 'TRUE' : 'FALSE';
        } elseif (!is_scalar($message)) {
            $messageStr = print_r($message, true);
        }
        return $messageStr;
    }