• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Suppressing ANT Task Output

Adobe Employee ,
Sep 08, 2009 Sep 08, 2009

Copy link to clipboard

Copied

Is there a way I can suppress all the [flexPmd] INFO output from the ANT task?

Thanks!

Brian

TOPICS
FlexPMD

Views

5.7K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Adobe Employee , Sep 08, 2009 Sep 08, 2009

You can also specify you own logging configuration:

http://java.ociweb.com/mark/programming/JavaLogging.html

HTH

Xavier

Votes

Translate

Translate
Adobe Employee ,
Sep 08, 2009 Sep 08, 2009

Copy link to clipboard

Copied

You mean entirely?

FYI, I move the log level from INFO to WARNING in RC4.

Xavier

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Sep 08, 2009 Sep 08, 2009

Copy link to clipboard

Copied

When run from ANT, I'd like to be able to specify not to see output unless there was an error in the process of running FlexPMD. Are these log levels part of ANT's built in logging mechanism? Maybe I just need to dig in an learn more about how that works?

Thanks!

Brian

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Sep 08, 2009 Sep 08, 2009

Copy link to clipboard

Copied

You can also specify you own logging configuration:

http://java.ociweb.com/mark/programming/JavaLogging.html

HTH

Xavier

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Sep 08, 2009 Sep 08, 2009

Copy link to clipboard

Copied

From what I see on the link you posted, I either have to rebuild FlexPMD or pass a properties file to the VM running my build script in order to make this change. These seem like extreme steps for simply modifying the log level of one of the tasks in my script. Is this standard practice for an controlling output from an ANT task?

Apologies if this has left the realm of a FlexPMD question now, it may be my own lack of knowledge in java logging. Thanks for the help!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Sep 09, 2009 Sep 09, 2009

Copy link to clipboard

Copied

      Java Logging can be configured in three ways.      

  1. from Java code
  2. from $JAVA_HOME/lib/logging.properties
  3. from a property file located elsewhere

      The last option is typically preferred.

The configuration property file must be specified by       setting the system property       java.util.logging.config.file.       This can be done when an application is run by specifying       -Djava.util.logging.config.file={file-path}       on the java command.       When running from ant, add the following as a child of the       java task.
              <sysproperty key="java.util.logging.config.file"           value="{file-path}"/>      

So you will need to add

<sysproperty key="java.util.logging.config.file"           value="{file-path}"/>

in your task def, in your project build.xml

You won't need to recompile FlexPMD. You only to modify your project build file.

HTH

Xavier

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Sep 09, 2009 Sep 09, 2009

Copy link to clipboard

Copied

Hi Xavier,

I appreciate your patience in helping me dig through these ant/java issues!

The problem is that sysproperty is only available in the java task, but not part of a taskdef or target. At the moment I'm trying to figure out if I can use java/taskdef to fork a new JVM where I can specify separate logging preferences.

Brian

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Sep 09, 2009 Sep 09, 2009

Copy link to clipboard

Copied

LATEST

I switched to the command line version to make this happen. Here is what I ended up having success with:

<java jar="${flexpmd.dir}/flex-pmd-command-line-${flexpmd.version}.jar" fork="true">      <jvmarg value="-Xmx256m"/>

     <sysproperty key="java.util.logging.config.file" value="${flexpmd.dir}/logging.properties"/>

     <arg value="-s"/>      <arg value="${src.dir}"/>      <arg value="-o"/>      <arg value="${dir.output.pmd}"/>      <arg value="-r"/>      <arg value="${dir.build}/pmd_ruleset.xml"/>      <classpath>           <pathelement location="flex-pmd-command-line-api-${flexpmd.version}.jar"/>

          <pathelement location="${flexpmd.dir}/flex-pmd-ruleset-api-${flexpmd.version}.jar"/>

          <pathelement location="${flexpmd.dir}/flex-pmd-ruleset-${flexpmd.version}.jar"/>

          <pathelement location="${flexpmd.dir}/flex-pmd-core-${flexpmd.version}.jar"/>

          <pathelement location="${flexpmd.dir}/as3-plugin-utils-${flexpmd.version}.jar"/>

          <pathelement location="${flexpmd.dir}/as3-parser-${flexpmd.version}.jar"/>

          <pathelement location="${flexpmd.dir}/pmd-4.2.2.jar"/>

          <pathelement location="${flexpmd.dir}/commons-lang-2.4.jar"/>

          <pathelement location="${flexpmd.dir}/flex-pmd-files-${flexpmd.version}.jar"/>

          <pathelement location="${flexpmd.dir}/as3-parser-api-${flexpmd.version}.jar"/>

          <pathelement location="${flexpmd.dir}/plexus-utils-1.0.2.jar"/>

     </classpath> </java>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines