import org.tianocore.common.definitions.EdkDefinitions;\r
import org.tianocore.common.exception.EdkException;\r
import org.tianocore.common.logger.EdkLog;\r
-import org.tianocore.pcd.action.ActionMessage;\r
import org.tianocore.build.FrameworkBuildTask;\r
import org.tianocore.build.global.GlobalData;\r
import org.tianocore.build.global.OutputManager;\r
// Pcd Collection. Call CollectPCDAction to collect pcd info.\r
//\r
PlatformPcdPreprocessActionForBuilding ca = new PlatformPcdPreprocessActionForBuilding();\r
- ca.perform(platformId.getFpdFile().getPath(), ActionMessage.NULL_MESSAGE_LEVEL);\r
+ ca.perform(platformId.getFpdFile().getPath());\r
} catch (IOException ex) {\r
BuildException buildException = new BuildException("Parsing of the FPD file [" + fpdFile.getPath() + "] failed!\n" + ex.getMessage());\r
buildException.setStackTrace(ex.getStackTrace());\r
import org.tianocore.build.autogen.CommonDefinition;\r
import org.tianocore.build.global.GlobalData;\r
import org.tianocore.build.id.ModuleIdentification;\r
-import org.tianocore.pcd.action.ActionMessage;\r
+import org.tianocore.common.logger.EdkLog;\r
import org.tianocore.pcd.action.BuildAction;\r
import org.tianocore.pcd.entity.MemoryDatabaseManager;\r
import org.tianocore.pcd.entity.Token;\r
@throws BuildActionException Failed to execute this aciton class.\r
**/\r
public void performAction() {\r
- ActionMessage.debug(this,\r
- "Starting PCDAutoGenAction to generate autogen.h and autogen.c!...");\r
+ EdkLog.log(EdkLog.EDK_DEBUG, "Starting PCDAutoGenAction to generate autogen.h and autogen.c!...");\r
\r
dbManager = GlobalData.getPCDMemoryDBManager();\r
\r
return;\r
}\r
\r
- ActionMessage.debug(this,\r
- "PCD memory database contains " + dbManager.getDBSize() + " PCD tokens.");\r
+ EdkLog.log(EdkLog.EDK_DEBUG, "PCD memory database contains " + dbManager.getDBSize() + " PCD tokens.");\r
\r
generateAutogenForModule();\r
}\r
import org.tianocore.build.exception.PlatformPcdPreprocessBuildException;\r
import org.tianocore.build.global.GlobalData;\r
import org.tianocore.build.id.FpdModuleIdentification;\r
-import org.tianocore.pcd.action.ActionMessage;\r
import org.tianocore.pcd.action.PlatformPcdPreprocessAction;\r
import org.tianocore.pcd.entity.MemoryDatabaseManager;\r
import org.tianocore.pcd.entity.ModulePcdInfoFromFpd;\r
///\r
private PlatformSurfaceAreaDocument fpdDocInstance;\r
\r
- /**\r
- Set action message level for CollectPcdAction tool.\r
-\r
- The message should be restored when this action exit.\r
-\r
- @param actionMessageLevel parameter for this action\r
- **/\r
- public void setActionMessageLevel(int actionMessageLevel) {\r
- originalMessageLevel = ActionMessage.messageLevel;\r
- ActionMessage.messageLevel = actionMessageLevel;\r
- }\r
-\r
/**\r
Set FPDFileName parameter for this action class.\r
\r
Common function interface for outer.\r
\r
@param fpdFilePath The fpd file path of current build or processing.\r
- @param messageLevel The message level for this Action.\r
\r
@throws PlatformPreprocessBuildException \r
The exception of this function. Because it can *not* be predict\r
where the action class will be used. So only Exception can be throw.\r
\r
**/\r
- public void perform(String fpdFilePath, int messageLevel) \r
+ public void perform(String fpdFilePath) \r
throws PlatformPcdPreprocessBuildException {\r
this.fpdFilePath = fpdFilePath;\r
- setActionMessageLevel(messageLevel);\r
checkParameter();\r
execute();\r
- ActionMessage.messageLevel = originalMessageLevel;\r
}\r
\r
/**\r
+++ /dev/null
-/** @file\r
- ActionMessage class.\r
-\r
- ActionMessage class take over all message for loging and waning. This class should\r
- dispatch message into different class according to instance class type.\r
-\r
-Copyright (c) 2006, Intel Corporation\r
-All rights reserved. This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution. The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-package org.tianocore.pcd.action;\r
-\r
-import org.apache.tools.ant.Task;\r
-\r
-/** ActionMessage class take over all message for loging and waning. This class\r
- should dispatch message into different Action class according to instance\r
- class type.\r
-**/\r
-public class ActionMessage {\r
- ///\r
- /// Macro definition for NULL messge level.\r
- /// In this meessage level, all message will be hidden.\r
- ///\r
- public final static int NULL_MESSAGE_LEVEL = 0;\r
-\r
- ///\r
- /// Macro definition for Log messge level.\r
- /// In this message level, Only log information will be shown.\r
- ///\r
- public final static int LOG_MESSAGE_LEVEL = 1;\r
-\r
- ///\r
- /// Macro definition for Warning message level.\r
- /// In this message level, log and waning message will be shown.\r
- ///\r
- public final static int WARNING_MESSAGE_LEVEL = 2;\r
-\r
- ///\r
- /// Macro definition for Debug mesage level.\r
- /// In this message level, log, warning, debug message will be shown.\r
- ///\r
- public final static int DEBUG_MESSAGE_LEVEL = 3;\r
-\r
- ///\r
- /// Macor definition for MAX message level.\r
- /// In this message level, all message will be shown.\r
- ///\r
- public final static int MAX_MESSAGE_LEVEL = 4;\r
-\r
- ///\r
- /// Current message level. It will control all message output for PCD tool.\r
- ///\r
- public static int messageLevel = NULL_MESSAGE_LEVEL;\r
-\r
- /**\r
- Log() function provide common log information functionality for all\r
- PCD tool includes all function\r
-\r
- This function will dispatch message to special class such as BuildAction\r
- Class, Entity Class etc.\r
-\r
- @param thisClass The class object who want log information.\r
- @param logStr The string contains log information.\r
- **/\r
- public static void log(Object thisClass, String logStr) {\r
- if(messageLevel < LOG_MESSAGE_LEVEL) {\r
- return;\r
- }\r
-\r
- if(thisClass instanceof Task) {\r
- BuildAction.logMsg(thisClass, "$$LOG$$:" + logStr);\r
- } else {\r
- System.out.println("$$LOG$$:" + logStr);\r
- }\r
- }\r
-\r
- /**\r
- Warning() function provide common warning information functionality for all\r
- PCD tool.\r
-\r
- This function will dispatch message to special class such as BuildAction\r
- Class, Entity Class etc.\r
-\r
- @param thisClass The class object who want warn information.\r
- @param warningStr The string contains warning information.\r
- **/\r
- public static void warning(Object thisClass, String warningStr) {\r
- if(messageLevel < WARNING_MESSAGE_LEVEL) {\r
- return;\r
- }\r
-\r
- if(thisClass instanceof Task) {\r
- BuildAction.warningMsg(thisClass, "**WARNING**:" + warningStr);\r
- } else {\r
- System.out.println("**WARNING**:" + warningStr);\r
- }\r
- }\r
-\r
- /**\r
- Debug() function provide common Debug information functionality for all\r
- PCD tool.\r
-\r
- This function will dispatch message to special class such as BuildAction\r
- Class, Entity Class etc.\r
-\r
- @param thisClass The class object who want Debug information.\r
- @param debugStr The string contains Debug information.\r
- **/\r
- public static void debug(Object thisClass, String debugStr) {\r
- if(messageLevel < DEBUG_MESSAGE_LEVEL) {\r
- return;\r
- }\r
-\r
- if(thisClass instanceof Task) {\r
- BuildAction.logMsg(thisClass, "%%DEBUG%%:" + debugStr);\r
- } else {\r
- System.out.println("%%DEBUG%%:" + debugStr);\r
- }\r
- }\r
-}\r
**/\r
public abstract void performAction() throws BuildActionException;\r
\r
- /**\r
- setMessageLevel function set current message for task instance object.\r
-\r
- The message should be restored when this action exit.\r
-\r
- @param messageLevel The message level for this action.\r
- **/\r
- public void setMessageLevel(int messageLevel) {\r
- originalMessageLevel = ActionMessage.messageLevel;\r
- ActionMessage.messageLevel = messageLevel;\r
- }\r
-\r
- /**\r
- logMsg function provide common log information functionality for all \r
- PCD tool extends from ANT task class.\r
-\r
- This function will use the log function in Ant task class.\r
- \r
- @param action The class object who want log information.\r
- @param logStr The string contains log information.\r
- **/\r
- public static void logMsg(Object action, String logStr) {\r
- try { \r
- ((Task) action).log(logStr, Project.MSG_INFO);\r
- } catch (Exception exp) {\r
- }\r
- }\r
-\r
- /**\r
- warningMsg function provide common warning information functionality for all \r
- PCD tool.\r
-\r
- This function will dispatch message to special class such as BuildAction\r
- Class, Entity Class etc.\r
- \r
- @param action The class object who want warn information.\r
- @param warningStr The string contains warning information.\r
- **/ \r
- public static void warningMsg(Object action, String warningStr) {\r
- ((Task) action).log(warningStr, Project.MSG_WARN);\r
- }\r
-\r
/**\r
execute function is the main flow for all build action class.\r
\r
public void execute() throws BuildActionException {\r
checkParameter();\r
performAction();\r
-\r
- //\r
- // Restore orignal message level when exist the action.\r
- //\r
- ActionMessage.messageLevel = originalMessageLevel;\r
}\r
}\r