Browse Source

If no logger is set, default to system.out instead of ignoring the

message.

This happens when ant is embeded ( if no logger is set ).

PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@273242 13f79535-47bb-0310-9956-ffa450edef68
master
Costin Manolache 23 years ago
parent
commit
8716cc5480
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      src/main/org/apache/tools/ant/ProjectComponent.java

+ 6
- 0
src/main/org/apache/tools/ant/ProjectComponent.java View File

@@ -115,6 +115,12 @@ public abstract class ProjectComponent {
public void log(String msg, int msgLevel) {
if (project != null) {
project.log(msg, msgLevel);
} else {
// 'reasonable' default, if the component is used without
// a Project ( for example as a standalone Bean ).
// Most ant components can be used this way.
if( msgLevel >= Project.MSG_INFO )
System.err.println( msg );
}
}
}

Loading…
Cancel
Save