Fixed EDKT370&372
authorqouyang <qouyang@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 10 Oct 2006 14:48:17 +0000 (14:48 +0000)
committerqouyang <qouyang@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 10 Oct 2006 14:48:17 +0000 (14:48 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1709 6f19259b-4bc3-4df7-8a09-765794883524

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

index 53d5cea..44eec53 100644 (file)
@@ -110,6 +110,7 @@ public class FrameworkBuildTask extends Task{
         // set Logger\r
         //\r
         GenBuildLogger logger = new GenBuildLogger(getProject());\r
+               EdkLog.setLogLevel(EdkLog.EDK_DEBUG);\r
         EdkLog.setLogLevel(getProject().getProperty("env.LOGLEVEL"));\r
         EdkLog.setLogger(logger);\r
         \r
index c7bc015..85ba166 100644 (file)
@@ -44,7 +44,10 @@ import org.tianocore.common.logger.LogMethod;
 public class GenBuildLogger extends DefaultLogger implements LogMethod {\r
     \r
     Project project = null;\r
-\r
+       ///\r
+    /// Time of the start of the build \r
+       /// \r
+    private long startTime = System.currentTimeMillis();\r
     ///\r
     /// flag to present whether cache all msg or not\r
     /// true means to cache.\r
@@ -76,7 +79,6 @@ public class GenBuildLogger extends DefaultLogger implements LogMethod {
         if (this.project == null) {\r
             return;\r
         }\r
-\r
         //\r
         // If msgLevel is always print, then print it\r
         //\r
@@ -96,7 +98,7 @@ public class GenBuildLogger extends DefaultLogger implements LogMethod {
         case EdkLog.EDK_INFO:\r
             log(msgSource, msg, Project.MSG_INFO);\r
             break;\r
-        case EdkLog.EDK_VERBOSE:\r
+               case EdkLog.EDK_VERBOSE:\r
             log(msgSource, msg, Project.MSG_VERBOSE);\r
             break;\r
         case EdkLog.EDK_DEBUG:\r
@@ -179,10 +181,7 @@ public class GenBuildLogger extends DefaultLogger implements LogMethod {
     }\r
     \r
     public void messageLogged(BuildEvent event) {\r
-        if (!enableFlag) {\r
-            return ;\r
-        }\r
-        int currentLevel = event.getPriority();\r
+               int currentLevel = event.getPriority();\r
         //\r
         // If current level is upper than Ant Level, skip it\r
         //\r
@@ -271,4 +270,40 @@ 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
+        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
+    }\r
 }
\ No newline at end of file
index 0140e8b..1e95eb2 100644 (file)
@@ -1828,9 +1828,6 @@ public class SurfaceAreaQuery {
             guidPair[0] = entry.getCName();\r
             guidPair[1] = entry.getGuidValue();\r
             guidDeclMap.put(entry.getCName(), guidPair);\r
-            EdkLog.log(EdkLog.EDK_VERBOSE, entry.getName());\r
-            EdkLog.log(EdkLog.EDK_VERBOSE, guidPair[0]);\r
-            EdkLog.log(EdkLog.EDK_VERBOSE, guidPair[1]);\r
         }\r
         return guidDeclMap;\r
     }\r
@@ -1859,9 +1856,6 @@ public class SurfaceAreaQuery {
             protocolPair[0] = entry.getCName();\r
             protocolPair[1] = entry.getGuidValue();\r
             protoclMap.put(entry.getCName(), protocolPair);\r
-            EdkLog.log(EdkLog.EDK_VERBOSE, entry.getName());\r
-            EdkLog.log(EdkLog.EDK_VERBOSE, protocolPair[0]);\r
-            EdkLog.log(EdkLog.EDK_VERBOSE, protocolPair[1]);\r
         }\r
         return protoclMap;\r
     }\r