views:

172

answers:

1

We are currently using CruiseControl.NET with NAnt 0.85 build scripts and while everything is working well, the log files are a little too verbose for my liking.

In particular, when deleting folders using the <delete> task I always get a [delete] Deleting directory entry in the log.

Fair enough but this task is run in a foreach loop and results in a long list of entries (especially if the folders contained files - each deletion is reported) which is just cluttering the log and making it difficulty to read without endless scrolling. I've added numerous <echo> tasks to report the scripts progress so don't really need all this 'fluff'.

I've used the verbose="false" attribute on the <delete> task and while this supressed the file deletion messages (which improved the log readability no end) the folder deletions are still reported. I've tried utilising the verbose attribute on the foreach but this made no difference.

Does anyone know how I can supress these messages or am I stuck with them .. ?

+3  A: 

I've looked into this before and it comes down to the internals of NAnt and the way the project's logging threshold cannot be properly controlled (arguably a bug). There has been good conversation around a non-intrusive workaround which is to create and consume a new task called LogLevel.

A use case would be the following:

<loglevel level="None">
    <delete file="helloworld.txt"/>
</loglevel>

The first post discussing this was from Shh, Keep it Quiet, by Jay Flowers. There was then a nice follow up to this post by Rory Primrose. Be sure to check the comments as there is very useful information revealed.

Scott Saad
Bah - Day off today, I'll have to check on Monday. Cheers Scott
DilbertDave
Sorted! I tried the link from Jay Flowers but that didn't work for me. Rorys post however sorted it out and I can now, finally, purge my logs of all this 'fluff'. Cheers
DilbertDave