Fixed EDKT372

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1751 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
qouyang 2006-10-16 06:14:02 +00:00
parent d61237595f
commit 5776c5c045

View File

@ -59,6 +59,10 @@ public class GenBuildLogger extends DefaultLogger implements LogMethod {
private static Map<FpdModuleIdentification, List<String>> map = new LinkedHashMap<FpdModuleIdentification, List<String> >(256); private static Map<FpdModuleIdentification, List<String>> map = new LinkedHashMap<FpdModuleIdentification, List<String> >(256);
private FpdModuleIdentification id = null; private FpdModuleIdentification id = null;
//
// semaroph for multi thread
//
public static Object semaphore = new Object();
public GenBuildLogger () { public GenBuildLogger () {
@ -270,38 +274,15 @@ public class GenBuildLogger extends DefaultLogger implements LogMethod {
} }
public void buildFinished(BuildEvent event) { public void buildFinished(BuildEvent event) {
Throwable error = event.getException(); if (this.msgOutputLevel >= Project.MSG_VERBOSE) {
StringBuffer message = new StringBuffer(); int level = this.msgOutputLevel;
synchronized(semaphore){
if (error == null) { this.msgOutputLevel = this.msgOutputLevel - 1;
message.append(StringUtils.LINE_SEP); super.buildFinished(event);
message.append("BUILD SUCCESSFUL"); this.msgOutputLevel = level;
} else { }
message.append(StringUtils.LINE_SEP); } else {
message.append("BUILD FAILED"); super.buildFinished(event);
message.append(StringUtils.LINE_SEP); }
if (Project.MSG_DEBUG <= msgOutputLevel
|| !(error instanceof BuildException)) {
message.append(StringUtils.getStackTrace(error));
} else {
if (error instanceof BuildException) {
message.append(error.toString()).append(lSep);
} else {
message.append(error.getMessage()).append(lSep);
}
}
}
message.append(StringUtils.LINE_SEP);
message.append("Total time: ");
message.append(formatTime(System.currentTimeMillis() - startTime));
String msg = message.toString();
if (error == null) {
printMessage(msg, out, Project.MSG_VERBOSE);
} else {
printMessage(msg, err, Project.MSG_ERR);
}
log(msg);
} }
} }