You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ra...@apache.org on 2021/09/20 09:25:47 UTC

[sling-scriptingbundle-maven-plugin] branch master updated: SLING-10824 - Lower the logging level in org.apache.sling.scriptingbundle.plugin.processor.FileProcessor

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

radu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-scriptingbundle-maven-plugin.git


The following commit(s) were added to refs/heads/master by this push:
     new 5688705  SLING-10824 - Lower the logging level in org.apache.sling.scriptingbundle.plugin.processor.FileProcessor
5688705 is described below

commit 5688705ed6efc107381b271e123a382477a4554f
Author: Radu Cotescu <ra...@apache.org>
AuthorDate: Mon Sep 20 11:24:13 2021 +0200

    SLING-10824 - Lower the logging level in org.apache.sling.scriptingbundle.plugin.processor.FileProcessor
    
    * switched from warn to debug
---
 .../org/apache/sling/scriptingbundle/plugin/bnd/BndLogger.java     | 5 +++++
 .../org/apache/sling/scriptingbundle/plugin/maven/MavenLogger.java | 5 +++++
 .../sling/scriptingbundle/plugin/processor/FileProcessor.java      | 5 +++--
 .../org/apache/sling/scriptingbundle/plugin/processor/Logger.java  | 7 +++++++
 .../apache/sling/scriptingbundle/plugin/processor/Slf4jLogger.java | 4 ++++
 5 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/apache/sling/scriptingbundle/plugin/bnd/BndLogger.java b/src/main/java/org/apache/sling/scriptingbundle/plugin/bnd/BndLogger.java
index 8a4734a..fb96b12 100644
--- a/src/main/java/org/apache/sling/scriptingbundle/plugin/bnd/BndLogger.java
+++ b/src/main/java/org/apache/sling/scriptingbundle/plugin/bnd/BndLogger.java
@@ -57,4 +57,9 @@ public class BndLogger implements Logger {
         String exception = Exceptions.causes(t);
         reporter.warning(message + ": " + exception);
     }
+
+    @Override
+    public void debug(@NotNull String message) {
+        reporter.trace(message);
+    }
 }
diff --git a/src/main/java/org/apache/sling/scriptingbundle/plugin/maven/MavenLogger.java b/src/main/java/org/apache/sling/scriptingbundle/plugin/maven/MavenLogger.java
index 7091600..77235fa 100644
--- a/src/main/java/org/apache/sling/scriptingbundle/plugin/maven/MavenLogger.java
+++ b/src/main/java/org/apache/sling/scriptingbundle/plugin/maven/MavenLogger.java
@@ -54,4 +54,9 @@ public class MavenLogger implements Logger {
     public void warn(@NotNull String message, Throwable t) {
         log.warn(message, t);
     }
+
+    @Override
+    public void debug(@NotNull String message) {
+        log.debug(message);
+    }
 }
diff --git a/src/main/java/org/apache/sling/scriptingbundle/plugin/processor/FileProcessor.java b/src/main/java/org/apache/sling/scriptingbundle/plugin/processor/FileProcessor.java
index 8a5f81d..514b681 100644
--- a/src/main/java/org/apache/sling/scriptingbundle/plugin/processor/FileProcessor.java
+++ b/src/main/java/org/apache/sling/scriptingbundle/plugin/processor/FileProcessor.java
@@ -217,10 +217,11 @@ public class FileProcessor {
                         );
                         providedCapabilities.add(builder.build());
                     } else {
-                        log.warn(String.format("Cannot find a script engine mapping for script %s.", scriptPath));
+                        log.debug(String.format("Cannot find a script engine mapping for script %s.", scriptPath));
                     }
                 } else {
-                    log.warn(String.format("Skipping file %s not denoting a script as it does not follow the filename patterns outlined at https://sling.apache.org/documentation/the-sling-engine/url-to-script-resolution.html#script-naming-conventions", scriptPath));
+                    log.debug(String.format("Skipping file %s not denoting a script as it does not follow the filename patterns outlined " +
+                            "at https://sling.apache.org/documentation/the-sling-engine/url-to-script-resolution.html#script-naming-conventions", scriptPath));
                 }
             } else {
                 throw new IllegalArgumentException(String.format("Invalid path given: '%s'.", scriptPath));
diff --git a/src/main/java/org/apache/sling/scriptingbundle/plugin/processor/Logger.java b/src/main/java/org/apache/sling/scriptingbundle/plugin/processor/Logger.java
index 7e94f59..1795156 100644
--- a/src/main/java/org/apache/sling/scriptingbundle/plugin/processor/Logger.java
+++ b/src/main/java/org/apache/sling/scriptingbundle/plugin/processor/Logger.java
@@ -62,4 +62,11 @@ public interface Logger {
      */
     void warn(@NotNull String message, @NotNull Throwable t);
 
+    /**
+     * Log a debug message.
+     *
+     * @param message the message
+     */
+    void debug(@NotNull String message);
+
 }
diff --git a/src/test/java/org/apache/sling/scriptingbundle/plugin/processor/Slf4jLogger.java b/src/test/java/org/apache/sling/scriptingbundle/plugin/processor/Slf4jLogger.java
index e56dceb..393e396 100644
--- a/src/test/java/org/apache/sling/scriptingbundle/plugin/processor/Slf4jLogger.java
+++ b/src/test/java/org/apache/sling/scriptingbundle/plugin/processor/Slf4jLogger.java
@@ -49,4 +49,8 @@ public class Slf4jLogger implements Logger {
         logger.warn(message, t);
     }
 
+    @Override
+    public void debug(@NotNull String message) {
+        logger.debug(message);
+    }
 }