phax / ph-schematron

Java Schematron library that supports XSLT and native application
Apache License 2.0
110 stars 36 forks source link

Silence [DEBUG] messages #128

Closed ruthrapr closed 2 years ago

ruthrapr commented 2 years ago

Hi @phax ,

is there a way to silence "[DEBUG]" messages ? My log is full of

[schematron] [DEBUG] Applying Schematron XSLT on XML [start]
[schematron] [DEBUG] Applying Schematron XSLT on XML [end]

and others debug messages.

I'm currently using ph-schematron-ant-task-6.2.8-jar-with-dependencies.jar called in an ANT task.

<target name="schematron.taskdef-init">
    <taskdef name="schematron" classname="com.helger.schematron.ant.Schematron"
        classpath="lib/ph-schematron-ant-task-6.2.8-jar-with-dependencies.jar"/>
</target>

<schematron schematronFile="sch/schematron.sch"
        expectSuccess="true" failOnError="${stop-process-on-error}"
        failOnValidationError="${stop-on-validation-error}" failOnValidationWarn="${stop-on-validation-warning}"
        failOnValidationInfo="${stop-on-validation-info}">
        <fileset dir="${dita.temp.dir}" includes="**/*.dita"/>
        <xmlcatalog refid="dita.catalog"/>
</schematron>

Thanks for your help

phax commented 2 years ago

Hmm, this seems to be a tricky question. Internally I am using SLF4J for logging. By default the plugin runs with "slf4j-simple" as the output logger, which emits only level INFO or more urgent. So there are 2 possibilities in my head:

  1. You are using another plugin/ANT installation that ships with a different SLF4J binding (like Log4J) which is configured to DEBUG or
  2. Somewhere in your classpath is a file simplelogger.properties which is used to customize "slf4j-simple", and in this file the loglevel is set to debug

hth

ruthrapr commented 2 years ago

Thanks for taking your time @phax

It was possibility 1, we ran DITA Open Toolkit with --verbose argument, which seems to emit level DEBUG (instead of INFO ?) (Logging build information).

Anyway, thx again and for you work! it's really useful for us

phax commented 2 years ago

Okay cool. Glad you found it. Thanks for the solution. Happy to hear that the software is used and beneficial.