On 14/09/2012, at 10:34 PM, Szczepan Faber wrote:

> Hey guys,
> 
> One of prominent users describes
> a following requirement: the debug logging should end up in a file but
> the lifecycle logging (or the current level if configured) should be
> visible on the console. The use case that drives that seems to be that
> their custom plugin logs some useful stuff at debug level and they
> want to get hold of that occasionally without requiring the developer
> to rerun the build with --debug.
> 
> In general, the idea like that makes sense to me. Many times I had to
> rerun the build with --debug but I couldn't reproduce some
> misbehavior. Or the build was long enough to make the re-run
> inconvenient and frustrating. Hence I always wanted gradle to
> automatically keep the --debug level logs somewhere for a couple of
> past builds.

I think this would be a useful thing to do out of the box.

> 
> One way to achieve that would be configuring appenders of Gradle
> logging. However, I don't think this is possible (or I couldn't manage
> to do it from a custom plugin).

project.logging.addOutputEventListener(new OutputEventListener() {
        public void onOutput(OutputEvent event) {
                // do what you like with the event
        }
});

These are internal types, however.


--
Adam Murdoch
Gradle Co-founder
http://www.gradle.org
VP of Engineering, Gradleware Inc. - Gradle Training, Support, Consulting
http://www.gradleware.com

Reply via email to