Fixed EDKT372
authorqouyang <qouyang@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 16 Oct 2006 06:14:02 +0000 (06:14 +0000)
committerqouyang <qouyang@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 16 Oct 2006 06:14:02 +0000 (06:14 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1751 6f19259b-4bc3-4df7-8a09-765794883524

Tools/Java/Source/GenBuild/org/tianocore/build/global/GenBuildLogger.java

index 2ab7a17..18ef849 100644 (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);\r
     \r
     private FpdModuleIdentification id = null;\r
+    //\r
+       //  semaroph for multi thread\r
+       // \r
+    public static Object semaphore = new Object();\r
     \r
     public GenBuildLogger () {\r
         \r
@@ -270,38 +274,15 @@ public class GenBuildLogger extends DefaultLogger implements LogMethod {
     }\r
 \r
     public void buildFinished(BuildEvent event) {\r
-        Throwable error = event.getException();\r
-        StringBuffer message = new StringBuffer();\r
-\r
-        if (error == null) {\r
-            message.append(StringUtils.LINE_SEP);\r
-            message.append("BUILD SUCCESSFUL");\r
-        } else {\r
-            message.append(StringUtils.LINE_SEP);\r
-            message.append("BUILD FAILED");\r
-            message.append(StringUtils.LINE_SEP);\r
-\r
-            if (Project.MSG_DEBUG <= msgOutputLevel\r
-                || !(error instanceof BuildException)) {\r
-                message.append(StringUtils.getStackTrace(error));\r
-            } else {\r
-                if (error instanceof BuildException) {\r
-                    message.append(error.toString()).append(lSep);\r
-                } else {\r
-                    message.append(error.getMessage()).append(lSep);\r
-                }\r
-            }\r
-        }\r
-        message.append(StringUtils.LINE_SEP);\r
-        message.append("Total time: ");\r
-        message.append(formatTime(System.currentTimeMillis() - startTime));\r
-\r
-        String msg = message.toString();\r
-        if (error == null) {\r
-            printMessage(msg, out, Project.MSG_VERBOSE);\r
-        } else {\r
-            printMessage(msg, err, Project.MSG_ERR);\r
-        }\r
-        log(msg);\r
+               if (this.msgOutputLevel >= Project.MSG_VERBOSE) {\r
+                       int level = this.msgOutputLevel;\r
+                       synchronized(semaphore){\r
+                           this.msgOutputLevel = this.msgOutputLevel - 1;\r
+                           super.buildFinished(event);\r
+                           this.msgOutputLevel = level;\r
+                       }\r
+               } else {\r
+                       super.buildFinished(event);\r
+               }\r
     }\r
 }
\ No newline at end of file