thank you for your reply erik.

it looks fairly straight-forward to create a new logger class (i.e. "NewLogger") that extends DefaultLogger and overrides the targetStarted(BuildEvent event) method as follows:

public void targetStarted(BuildEvent event) {
if (Project.MSG_INFO <= msgOutputLevel) {
String msg = StringUtils.LINE_SEP
+ event.getProject().getName() + "."
+ event.getTarget().getName() + ":";
printMessage(msg, out, event.getPriority());
log(msg);
}
}


when i want to use this new logging class, then am i correct to assume that upon each ant execution, i need to specify it as follows?

> ant -logger NewLogger <target>


if so, is there a way to specify the logger to be used in something like an ant.properties file, such that ant can be executed as normal, without explicity specifying "-logger NewLogger" each time? if not, no problem.

out of curiosity, have any other people requested the ability to change the target name lines (i.e. "init: ")? if so, then a suggestion for a future feature is to adopt a junit-style syntax (i.e. "%P.%T" which would print <projectName>.<targetName>; and other %... options) and specify these in a ant-log.properties file or something? just an idea.

thanks again for the great advice to solving my problem!



At 13:03 03/01/10 -0500, you wrote:
You could write a custom BuildLogger implementation that would do this, no problem. Would be fairly easy. Have a look at the DefaultLogger built into Ant for inspiration.

Erik

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to