]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Java/Source/GenBuild/org/tianocore/build/global/GenBuildLogger.java
Fixed EDKT372
[mirror_edk2.git] / Tools / Java / Source / GenBuild / org / tianocore / build / global / GenBuildLogger.java
index c7bc01599b95c5689cd33bdb5d4f001b1a83f874..18ef849ed02a8b24c70b704317842f341d9ec44b 100644 (file)
@@ -44,18 +44,25 @@ import org.tianocore.common.logger.LogMethod;
 public class GenBuildLogger extends DefaultLogger implements LogMethod {\r
     \r
     Project project = null;\r
-\r
+    \r
+    ///\r
+    /// Time of the start of the build \r
+    ///\r
+    private long startTime = System.currentTimeMillis();\r
+    \r
     ///\r
     /// flag to present whether cache all msg or not\r
     /// true means to cache.\r
     ///\r
     private static boolean flag = false;\r
-    \r
-    private static boolean enableFlag = true;\r
 \r
     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
@@ -179,9 +186,7 @@ public class GenBuildLogger extends DefaultLogger implements LogMethod {
     }\r
     \r
     public void messageLogged(BuildEvent event) {\r
-        if (!enableFlag) {\r
-            return ;\r
-        }\r
+        \r
         int currentLevel = event.getPriority();\r
         //\r
         // If current level is upper than Ant Level, skip it\r
@@ -234,10 +239,6 @@ public class GenBuildLogger extends DefaultLogger implements LogMethod {
         flag = enable;\r
     }\r
     \r
-    public static void maskAllLog(boolean enable) {\r
-        enableFlag = !enable;\r
-    }\r
-    \r
     protected synchronized void log(String message) {\r
         //\r
         // cache log\r
@@ -271,4 +272,17 @@ public class GenBuildLogger extends DefaultLogger implements LogMethod {
     public void setId(FpdModuleIdentification id) {\r
         this.id = id;\r
     }\r
+\r
+    public void buildFinished(BuildEvent event) {\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