kalo
kalo

Reputation: 408

Suppress the output of a Phing target ?

Is there an option to suppress the default output shown when a target is executed in Phing. I have a

<foreach param="my_param" absparam="my_abs_param" target="my-target">
      <fileset dir="www">
          <include name="lots-of-files-here" />
      </fileset>
</foreach>

Where the target does a simple check on each directory which output is not useful at all but prints huge amount of messages telling my-target is called:

 > my-target:
[foreach] Calling Buildfile 'build.xml' with target 'my-target'.

Is there a way to disable that output?

Upvotes: 5

Views: 869

Answers (2)

corretge
corretge

Reputation: 1759

For an specific target you can't. For the whole execution you can specify silent argument:

bin/phing -silent db.wanup.deploy

Added:

If you want to view few of your echoes, then you should execute it in quiet mode:

bin/phing -quiet

And set your echo echo level to warning or error. Control the level at which this message is reported. One of "error", "warning", "info", "verbose", "debug" (decreasing order)

<echo level="warning"> món! </echo>

Quick sample:

With this sample build file

<?xml version="1.0" ?>

<target name="list">
    <echo>  Hola </echo>
    <phingcall target="mon" />

</target>

<target name="mon" >
    <echo level="warning"> món! </echo>
</target>

When we execute phing without arguments, we get:

Buildfile: /private/tmp/build.xml

silent execution > list:

     [echo]   Hola

silent execution > mon:

     [echo]  món!

BUILD FINISHED

Total time: 0.2197 seconds

But when we execute phing with -quiet argument ( -q -quiet be extra quiet ) we get:

     [echo]  món!

BUILD FINISHED

Total time: 0.1822 seconds

Upvotes: 2

Michiel
Michiel

Reputation: 171

Thanks for the question! Phing does not support supression of specific task output, but foreach/phingcall should not produce this much chatter. This should be fixed in the upcoming 2.9.0, I've created a tracking ticket at http://www.phing.info/trac/ticket/1144.

Upvotes: 0

Related Questions