You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by vy...@apache.org on 2023/01/30 12:13:50 UTC

[logging-log4j-tools] branch windows-fixes updated: Try debugging via CI.

This is an automated email from the ASF dual-hosted git repository.

vy pushed a commit to branch windows-fixes
in repository https://gitbox.apache.org/repos/asf/logging-log4j-tools.git


The following commit(s) were added to refs/heads/windows-fixes by this push:
     new dc06c61  Try debugging via CI.
dc06c61 is described below

commit dc06c61ee74a489c7f3f94d26fb115b0d1e74ec5
Author: Volkan Yazıcı <vo...@yazi.ci>
AuthorDate: Mon Jan 30 13:15:11 2023 +0100

    Try debugging via CI.
---
 .../org/apache/logging/log4j/changelog/exporter/FreeMarkerUtils.java   | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/log4j-changelog/src/main/java/org/apache/logging/log4j/changelog/exporter/FreeMarkerUtils.java b/log4j-changelog/src/main/java/org/apache/logging/log4j/changelog/exporter/FreeMarkerUtils.java
index efc03e8..5ed4c2c 100644
--- a/log4j-changelog/src/main/java/org/apache/logging/log4j/changelog/exporter/FreeMarkerUtils.java
+++ b/log4j-changelog/src/main/java/org/apache/logging/log4j/changelog/exporter/FreeMarkerUtils.java
@@ -59,12 +59,13 @@ final class FreeMarkerUtils {
 
     @SuppressFBWarnings("TEMPLATE_INJECTION_FREEMARKER")
     static void render(final Path templateFile, final Object templateData, final Path outputFile) {
+        System.out.format(">>> templateFile: `%s` (exists: %s)%n", templateFile, Files.exists(templateFile));
         // Since we are using `FileTemplateLoader`, template names refer to actual file paths.
         // On Windows, this causes failures; FreeMarker doesn't allow backslashes in the template name.
         // As a workaround, we are replacing backslashes with slashes.
         final String templateName = File.separatorChar == '/'
                 ? templateFile.toAbsolutePath().toString()
-                : ('/' + templateFile.toAbsolutePath().toString().replace('\\', '/'));
+                : templateFile.toAbsolutePath().toString().replace('\\', '/');
         try {
             final Template template = CONFIGURATION.getTemplate(templateName);
             final Path outputFileParent = outputFile.getParent();