On 1/07/10 6:56 AM, Rene Groeschke wrote:
hi there,
I just tried to use a custom logger like explained in example 16.6 of the gradle user guide. When running the example with the plain call "useLogger(new CustomLogger())" the build fails because the method useLogger can not be resolved. If I use "gradle.useLogger(new CustomLogger())" it works. who/what is wrong here? me, the userguide, or the implementation?"

I guess it's the user guide that's the problem here. The example shows an init script, not a build script. Init scripts delegate to a Gradle instance, so useLogger() ends up calling Gradle.useLogger(). Build scripts, on the other hand, delegate to a Project instance, which doesn't have a useLogger() method. This is why useLogger() doesn't work and gradle.useLogger() does in the build script.

This could be clearer in the user guide.

We could, I suppose, add a Project.useLogger() method. Gradle.useLogger() uses the given logger for all projects in the build. Project.useLogger() method should probably only apply the logger for events from that project (and maybe it's child projects). So, even if we added Project.useLogger(), it would work differently to Gradle.useLogger().


--
Adam Murdoch
Gradle Developer
http://www.gradle.org
CTO, Gradle Inc. - Gradle Training, Support, Consulting
http://www.gradle.biz


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email


Reply via email to