Vincent,

You accomplish this by setting the message level of your own echo tasks to
"Warning"

eg.

<echo message="..." level="Warning" />

and run the build in quiet mode

eg. NAnt.exe -buildfile:<build file> -quiet

which will only output messages with level Warning or Error.

Gert

----- Original Message -----
From: "Vincent Erickson" <[EMAIL PROTECTED]>
To: "Gert Driesen" <[EMAIL PROTECTED]>
Sent: Wednesday, March 17, 2004 5:10 PM
Subject: RE: [Nant-users] How do you mail the build log on failure?


I am already using the MailLogger for emailing nightly NAnt build logs to
myself, but I have a question. The log for the nightly build is huge, and
90% of the messages logged in it I don't really care about. I really only
want to know about task start and completion messages, my own echos, and any
failure messages. I see that there is a Threshold property I can set in
MailLogger, which would seem to give me some control over what gets sent to
me, but I don't see any documentation on what values to use for what
messages, etc. Do you have any information or advice on this? Thanks.

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Gert Driesen
Sent: Wednesday, March 17, 2004 7:05 AM
To: Darrel Herbst; [EMAIL PROTECTED]
Subject: Re: [Nant-users] How do you mail the build log on failure?


use the NAnt.Core.MailLogger :

NAnt.exe -buildfile:.... -logger:NAnt.Core.MailLogger

you need to configure the MailLogger using a predefined set of properties in
your buildfile (see the NAnt SDK docs for more information) :

    <property name="MailLogger.mailhost" value="mail.dunnowhat.com" />
    <property name="MailLogger.from" value="[EMAIL PROTECTED]" />
    <property name="MailLogger.failure.notify" value="true" />
    <property name="MailLogger.success.notify" value="true" />
    <property name="MailLogger.failure.to"  value="[EMAIL PROTECTED]" />
    <property name="MailLogger.success.to" value="[EMAIL PROTECTED]" />
    <property name="MailLogger.failure.subject" value="build failure" />
    <property name="MailLogger.success.subject" value="build success" />

Hope this helps,

Gert

----- Original Message -----
From: "Darrel Herbst" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, March 17, 2004 3:34 PM
Subject: [Nant-users] How do you mail the build log on failure?


I would like to set up a nightly build/test file which will email out the
build log if the build fails, but I keep getting this message below, which
looks to me as though the build log file is locked, so nant cannot read in
the file while it is writing it at the same time.  How do other people mail
out the build log when their build breaks?

Thanks in advance for your help.

build_failed:

     [mail] File 'C:\dherbst\src\Build\nightly.txt' NOT added to  message
body. File does not exist or cannot be accessed.
     [mail] Sending mail to [EMAIL PROTECTED]

BUILD FAILED

C:\dherbst\src\Build\nightly.build(639,7):
External Program Failed: C:\WINNT\Microsoft.NET\Framework\v1.1.4322\vbc.exe
(ret
urn code was 1)

Total time: 32 seconds.

I have a windows task set up to do our build and test runs at 4am, it runs
the nightly.bat script below:

echo Starting the nightly build
echo .
del nightly.txt
echo .
C:\dherbst\bin\nant\bin\NAnt.exe -logfile:nightly.txt

In the nightly.build script I have the following:

  <!-- Set the onFailure property so you get the emails out for the nightly
build -->
  <property name="nant.onfailure" value="build_failed" />

And the failure target:
  <!-- Failure target to send a mail that the build failed -->
  <target name="build_failed" >

     <mail if="${SendMailResults}"
           from="[EMAIL PROTECTED]"
           tolist="[EMAIL PROTECTED]"
   mailhost="mail"
   message="You ... have ...      f a i l e d.

   The nightly build has failed.   Sorry.   Thank you for playing.

For Details, please see below:
----------------------------------
  "
   subject="[Build]"
   >
   <files>
               <includes name="nightly.txt" />
           </files>
     </mail>
  </target>


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo
technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=ick
_______________________________________________
Nant-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-users




-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo
technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Nant-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-users


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.591 / Virus Database: 374 - Release Date: 2/17/2004


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.591 / Virus Database: 374 - Release Date: 2/17/2004






-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Nant-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to