From 5776c5c045abf935cbfd3e1e7b4c2ae0a2a419e2 Mon Sep 17 00:00:00 2001 From: qouyang Date: Mon, 16 Oct 2006 06:14:02 +0000 Subject: [PATCH] Fixed EDKT372 git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1751 6f19259b-4bc3-4df7-8a09-765794883524 --- .../build/global/GenBuildLogger.java | 47 ++++++------------- 1 file changed, 14 insertions(+), 33 deletions(-) diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/global/GenBuildLogger.java b/Tools/Java/Source/GenBuild/org/tianocore/build/global/GenBuildLogger.java index 2ab7a17e03..18ef849ed0 100644 --- a/Tools/Java/Source/GenBuild/org/tianocore/build/global/GenBuildLogger.java +++ b/Tools/Java/Source/GenBuild/org/tianocore/build/global/GenBuildLogger.java @@ -59,6 +59,10 @@ public class GenBuildLogger extends DefaultLogger implements LogMethod { private static Map> map = new LinkedHashMap >(256); private FpdModuleIdentification id = null; + // + // semaroph for multi thread + // + public static Object semaphore = new Object(); public GenBuildLogger () { @@ -270,38 +274,15 @@ public class GenBuildLogger extends DefaultLogger implements LogMethod { } public void buildFinished(BuildEvent event) { - Throwable error = event.getException(); - StringBuffer message = new StringBuffer(); - - if (error == null) { - message.append(StringUtils.LINE_SEP); - message.append("BUILD SUCCESSFUL"); - } else { - message.append(StringUtils.LINE_SEP); - message.append("BUILD FAILED"); - 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); + if (this.msgOutputLevel >= Project.MSG_VERBOSE) { + int level = this.msgOutputLevel; + synchronized(semaphore){ + this.msgOutputLevel = this.msgOutputLevel - 1; + super.buildFinished(event); + this.msgOutputLevel = level; + } + } else { + super.buildFinished(event); + } } } \ No newline at end of file -- 2.39.2