public function setTemplateDir(string $templateDir): self
    {
        $this->templateDir = rtrim($templateDir, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
        $this->logger->debug("Template directory set to loader." , ["templateDir" => $this->templateDir]);
        return $this;
    }