Add exception and log mechanism
[mirror_edk2.git] / Tools / Source / GenBuild / org / tianocore / build / GenBuildTask.java
index 5ee07fb34edc84643d82140139892dcae317f77e..3127b8706dc3b1dd8a3344fb0089f6782a23cb55 100644 (file)
@@ -50,10 +50,12 @@ import org.w3c.dom.Node;
 import org.tianocore.build.autogen.AutoGen;\r
 import org.tianocore.build.autogen.CommonDefinition;\r
 import org.tianocore.build.fpd.FpdParserTask;\r
 import org.tianocore.build.autogen.AutoGen;\r
 import org.tianocore.build.autogen.CommonDefinition;\r
 import org.tianocore.build.fpd.FpdParserTask;\r
+import org.tianocore.build.global.GenBuildLogger;\r
 import org.tianocore.build.global.GlobalData;\r
 import org.tianocore.build.global.OutputManager;\r
 import org.tianocore.build.global.SurfaceAreaQuery;\r
 import org.tianocore.build.toolchain.ToolChainFactory;\r
 import org.tianocore.build.global.GlobalData;\r
 import org.tianocore.build.global.OutputManager;\r
 import org.tianocore.build.global.SurfaceAreaQuery;\r
 import org.tianocore.build.toolchain.ToolChainFactory;\r
+import org.tianocore.logger.EdkLog;\r
 import org.tianocore.FilenameDocument;\r
 import org.tianocore.MsaHeaderDocument;\r
 import org.tianocore.MsaLibHeaderDocument;\r
 import org.tianocore.FilenameDocument;\r
 import org.tianocore.MsaHeaderDocument;\r
 import org.tianocore.MsaLibHeaderDocument;\r
@@ -200,6 +202,13 @@ public class GenBuildTask extends Task {
     **/\r
     public void execute() throws BuildException {\r
         System.out.println("Module [" + baseName + "] start.");\r
     **/\r
     public void execute() throws BuildException {\r
         System.out.println("Module [" + baseName + "] start.");\r
+        //\r
+        // Inital GenBuild log  method \r
+        //\r
+        GenBuildLogger logger = new GenBuildLogger(getProject());\r
+        EdkLog.setLogger(logger);\r
+        EdkLog.setLogLevel(1);\r
+        \r
         OutputManager.update(getProject());\r
         GlobalData.initInfo("Tools" + File.separatorChar + "Conf" + File.separatorChar + "FrameworkDatabase.db",\r
                             getProject().getProperty("WORKSPACE_DIR"));\r
         OutputManager.update(getProject());\r
         GlobalData.initInfo("Tools" + File.separatorChar + "Conf" + File.separatorChar + "FrameworkDatabase.db",\r
                             getProject().getProperty("WORKSPACE_DIR"));\r