You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Cena, Bernard (IT)" <Be...@morganstanley.com> on 2005/11/10 18:24:06 UTC

Logging from custom tasks

Are there any "best practices" for which logging levels to use from
custom ant tasks ?
The 5 levels: MSG_ERR, MSG_WARN, MSG_INFO, MSG_VERBOSE and MSG_DEBUG are
self explanatory, but I'm not certain which levels appear when ? I'm
asking which levels are visible depending on options supplied to ant
(-v, -q, -d) ? Also, is <echo> equivalent of logging at the info level ?
(Asking about this from the point of view of using a custom logger such
as the color logger).
Thanks
Bernard
--------------------------------------------------------

NOTICE: If received in error, please destroy and notify sender.  Sender does not waive confidentiality or privilege, and use is prohibited.

Re: Logging from custom tasks

Posted by Dominique Devienne <dd...@gmail.com>.
normal mode ==> shows INFO and above (ERR and WARN)
-v adds VERBOSE
-d adds DEBUG

-q logs only ERR and WARN (I think. I used it seldomly)

one "best practice" is to be silent if the task does nothing, when
everything's up to date for example.

When it does something, log at the default level (INFO) says what it
does (e.g. compiling X files to /this/dir).

Sprinkle some VERBOSE and DEBUG messages to help troubleshooting the
task. Typically, explain at VERBOSE level why nothing's done for
example (up-to-date, already there, etc...) I sometimes put timing
data at VERBOSE or DEBUG level too.

Beyond this, it's mostly a matter of taste and experience. I hope this
helps. --DD

On 11/10/05, Cena, Bernard (IT) <Be...@morganstanley.com> wrote:
> Are there any "best practices" for which logging levels to use from
> custom ant tasks ?
> The 5 levels: MSG_ERR, MSG_WARN, MSG_INFO, MSG_VERBOSE and MSG_DEBUG are
> self explanatory, but I'm not certain which levels appear when ? I'm
> asking which levels are visible depending on options supplied to ant
> (-v, -q, -d) ? Also, is <echo> equivalent of logging at the info level ?
> (Asking about this from the point of view of using a custom logger such
> as the color logger).
> Thanks
> Bernard
> --------------------------------------------------------
>
> NOTICE: If received in error, please destroy and notify sender.  Sender does not waive confidentiality or privilege, and use is prohibited.
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Logging from custom tasks

Posted by Jeffrey E Care <ca...@us.ibm.com>.
I can't remember off the top of my head about -q, but the default level is 
INFO which would give you ERROR, WARNING & INFO. The -v flag gives you 
that plus VERBOSE, while -d gives you everything.

-- 
Jeffrey E. Care (carej@us.ibm.com)
WebSphere v7 Release Engineer
WebSphere Build Tooling Lead (Project Mantis)


"Cena, Bernard \(IT\)" <Be...@morganstanley.com> wrote on 
11/10/2005 12:24:06 PM:

> Are there any "best practices" for which logging levels to use from
> custom ant tasks ?
> The 5 levels: MSG_ERR, MSG_WARN, MSG_INFO, MSG_VERBOSE and MSG_DEBUG are
> self explanatory, but I'm not certain which levels appear when ? I'm
> asking which levels are visible depending on options supplied to ant
> (-v, -q, -d) ? Also, is <echo> equivalent of logging at the info level ?
> (Asking about this from the point of view of using a custom logger such
> as the color logger).
> Thanks
> Bernard
> --------------------------------------------------------
> 
> NOTICE: If received in error, please destroy and notify sender. 
> Sender does not waive confidentiality or privilege, and use is 
prohibited.