You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Gilles Scokart <gs...@hotmail.com> on 2005/09/28 12:24:06 UTC

Logging/tracing conventions

When writting a Mojo, what are the standard convention to trace/log [debug] 
messages ?


Gilles Scokart

_________________________________________________________________
Protégez votre boîte de réception: Phishing : comment l'identifier, le 
signaler et l'empêcher   http://www.fr.msn.be/security/phishing/


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Logging/tracing conventions

Posted by Jamie Bisotti <jb...@gmail.com>.
On 9/28/05, Orjan Austvold <au...@colibria.com> wrote:
>
> Instead of having lots of debug statements in your Mojo, you could
> simply connect a debugger to Maven.
>
> I'm doing this with IDEA simply by running maven with
>
> MAVEN_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE
> -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005" m2 install
>
>
> Ørjan
>
>
> Gilles Scokart wrote:
> >
> > When writting a Mojo, what are the standard convention to trace/log
> > [debug] messages ?
> >
> >
> > Gilles Scokart
> >
> > _________________________________________________________________
> > Protégez votre boîte de réception: Phishing : comment l'identifier, le
> > signaler et l'empêcher http://www.fr.msn.be/security/phishing/
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
>
> --
> Ørjan Austvold - Senior Software Architect
> www.colibria.com <http://www.colibria.com> - putting the presence into
> messaging
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Using a debugger in place of log statements if a bad idea!

--
Jamie Bisotti

Re: Logging/tracing conventions

Posted by Orjan Austvold <au...@colibria.com>.
Instead of having lots of debug statements in your Mojo, you could 
simply connect a debugger to Maven.

I'm doing this with IDEA simply by running maven with

MAVEN_OPTS="-Xdebug -Xnoagent -Djava.compiler=NONE 
-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005" m2 install


Ørjan


Gilles Scokart wrote:
> 
> When writting a Mojo, what are the standard convention to trace/log 
> [debug] messages ?
> 
> 
> Gilles Scokart
> 
> _________________________________________________________________
> Protégez votre boîte de réception: Phishing : comment l'identifier, le 
> signaler et l'empêcher   http://www.fr.msn.be/security/phishing/
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 

-- 
Ørjan Austvold - Senior Software Architect
www.colibria.com - putting the presence into messaging

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Logging/tracing conventions

Posted by Brett Porter <br...@gmail.com>.
On 9/29/05, Gilles Scokart <gs...@hotmail.com> wrote:
> Thanks, but what are the guidelines on when to log at which level ?  I guess
> it's a good idea that all plugins follow the same guidelines.  What is the
> best practice for that ?

This should all be information for the user: ERROR for things that
went wrong (generally this will result in a failure/exception
instead), WARN for things that need attention but not a problem, and
INFO for general progress (this won't be displayed if we have a quiet
mode).

DEBUG for verbose information to help them diagnose a problem.

>
> And what if our mojo call external code that is not (and should not be)
> aware of running into a maven plugin ?

In theory it is possible to configure log4j and commons-logging from
the plexus container that Maven runs in. That is probably what would
need to happen but I'd have to look at a specific case to see how this
plays out.

- Brett

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Logging/tracing conventions

Posted by Gilles Scokart <gs...@hotmail.com>.
Thanks, but what are the guidelines on when to log at which level ?  I guess 
it's a good idea that all plugins follow the same guidelines.  What is the 
best practice for that ?

And what if our mojo call external code that is not (and should not be) 
aware of running into a maven plugin ?


> > When writting a Mojo, what are the standard convention to trace/log 
>[debug]
> > messages ?
>
>getLog().info( "Hey yo!" );
>
>--
>Trygve

_________________________________________________________________
Protégez votre boîte de réception: Phishing : comment l'identifier, le 
signaler et l'empêcher   http://www.fr.msn.be/security/phishing/


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Logging/tracing conventions

Posted by Trygve Laugstøl <tr...@codehaus.org>.
On Wed, 2005-09-28 at 12:24 +0200, Gilles Scokart wrote:
> When writting a Mojo, what are the standard convention to trace/log [debug] 
> messages ?

getLog().info( "Hey yo!" );

--
Trygve



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org