|
|
@@ -2147,32 +2147,32 @@ public class Project implements ResourceFactory { |
|
|
|
} else { |
|
|
|
event.setMessage(message, priority); |
|
|
|
} |
|
|
|
if (isLoggingMessage.get() != Boolean.FALSE) { |
|
|
|
/* |
|
|
|
* One of the Listeners has attempted to access |
|
|
|
* System.err or System.out. |
|
|
|
* |
|
|
|
* We used to throw an exception in this case, but |
|
|
|
* sometimes Listeners can't prevent it(like our own |
|
|
|
* Log4jListener which invokes getLogger() which in |
|
|
|
* turn wants to write to the console). |
|
|
|
* |
|
|
|
* @see http://marc.theaimsgroup.com/?t=110538624200006&r=1&w=2 |
|
|
|
* |
|
|
|
* We now (Ant 1.6.3 and later) simply swallow the message. |
|
|
|
*/ |
|
|
|
return; |
|
|
|
} |
|
|
|
try { |
|
|
|
isLoggingMessage.set(Boolean.TRUE); |
|
|
|
Iterator iter = listeners.iterator(); |
|
|
|
while (iter.hasNext()) { |
|
|
|
BuildListener listener = (BuildListener) iter.next(); |
|
|
|
listener.messageLogged(event); |
|
|
|
} |
|
|
|
} finally { |
|
|
|
isLoggingMessage.set(Boolean.FALSE); |
|
|
|
if (isLoggingMessage.get() != Boolean.FALSE) { |
|
|
|
/* |
|
|
|
* One of the Listeners has attempted to access |
|
|
|
* System.err or System.out. |
|
|
|
* |
|
|
|
* We used to throw an exception in this case, but |
|
|
|
* sometimes Listeners can't prevent it(like our own |
|
|
|
* Log4jListener which invokes getLogger() which in |
|
|
|
* turn wants to write to the console). |
|
|
|
* |
|
|
|
* @see http://marc.theaimsgroup.com/?t=110538624200006&r=1&w=2 |
|
|
|
* |
|
|
|
* We now (Ant 1.6.3 and later) simply swallow the message. |
|
|
|
*/ |
|
|
|
return; |
|
|
|
} |
|
|
|
try { |
|
|
|
isLoggingMessage.set(Boolean.TRUE); |
|
|
|
Iterator iter = listeners.iterator(); |
|
|
|
while (iter.hasNext()) { |
|
|
|
BuildListener listener = (BuildListener) iter.next(); |
|
|
|
listener.messageLogged(event); |
|
|
|
} |
|
|
|
} finally { |
|
|
|
isLoggingMessage.set(Boolean.FALSE); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|