Fix EDKT256: using unified logging mechanism in PcdAutogen tools.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1626 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
klu2
2006-09-26 06:11:15 +00:00
parent 97aac8557c
commit e8c0c170fa
5 changed files with 5 additions and 197 deletions

View File

@@ -37,7 +37,6 @@ import org.apache.xmlbeans.XmlObject;
import org.tianocore.common.definitions.EdkDefinitions;
import org.tianocore.common.exception.EdkException;
import org.tianocore.common.logger.EdkLog;
import org.tianocore.pcd.action.ActionMessage;
import org.tianocore.build.FrameworkBuildTask;
import org.tianocore.build.global.GlobalData;
import org.tianocore.build.global.OutputManager;
@@ -454,7 +453,7 @@ public class FpdParserTask extends Task {
// Pcd Collection. Call CollectPCDAction to collect pcd info.
//
PlatformPcdPreprocessActionForBuilding ca = new PlatformPcdPreprocessActionForBuilding();
ca.perform(platformId.getFpdFile().getPath(), ActionMessage.NULL_MESSAGE_LEVEL);
ca.perform(platformId.getFpdFile().getPath());
} catch (IOException ex) {
BuildException buildException = new BuildException("Parsing of the FPD file [" + fpdFile.getPath() + "] failed!\n" + ex.getMessage());
buildException.setStackTrace(ex.getStackTrace());

View File

@@ -25,7 +25,7 @@ import org.tianocore.build.FrameworkBuildTask;
import org.tianocore.build.autogen.CommonDefinition;
import org.tianocore.build.global.GlobalData;
import org.tianocore.build.id.ModuleIdentification;
import org.tianocore.pcd.action.ActionMessage;
import org.tianocore.common.logger.EdkLog;
import org.tianocore.pcd.action.BuildAction;
import org.tianocore.pcd.entity.MemoryDatabaseManager;
import org.tianocore.pcd.entity.Token;
@@ -190,8 +190,7 @@ public class PCDAutoGenAction extends BuildAction {
@throws BuildActionException Failed to execute this aciton class.
**/
public void performAction() {
ActionMessage.debug(this,
"Starting PCDAutoGenAction to generate autogen.h and autogen.c!...");
EdkLog.log(EdkLog.EDK_DEBUG, "Starting PCDAutoGenAction to generate autogen.h and autogen.c!...");
dbManager = GlobalData.getPCDMemoryDBManager();
@@ -199,8 +198,7 @@ public class PCDAutoGenAction extends BuildAction {
return;
}
ActionMessage.debug(this,
"PCD memory database contains " + dbManager.getDBSize() + " PCD tokens.");
EdkLog.log(EdkLog.EDK_DEBUG, "PCD memory database contains " + dbManager.getDBSize() + " PCD tokens.");
generateAutogenForModule();
}

View File

@@ -32,7 +32,6 @@ import org.tianocore.PlatformSurfaceAreaDocument;
import org.tianocore.build.exception.PlatformPcdPreprocessBuildException;
import org.tianocore.build.global.GlobalData;
import org.tianocore.build.id.FpdModuleIdentification;
import org.tianocore.pcd.action.ActionMessage;
import org.tianocore.pcd.action.PlatformPcdPreprocessAction;
import org.tianocore.pcd.entity.MemoryDatabaseManager;
import org.tianocore.pcd.entity.ModulePcdInfoFromFpd;
@@ -62,18 +61,6 @@ public class PlatformPcdPreprocessActionForBuilding extends PlatformPcdPreproces
///
private PlatformSurfaceAreaDocument fpdDocInstance;
/**
Set action message level for CollectPcdAction tool.
The message should be restored when this action exit.
@param actionMessageLevel parameter for this action
**/
public void setActionMessageLevel(int actionMessageLevel) {
originalMessageLevel = ActionMessage.messageLevel;
ActionMessage.messageLevel = actionMessageLevel;
}
/**
Set FPDFileName parameter for this action class.
@@ -87,20 +74,17 @@ public class PlatformPcdPreprocessActionForBuilding extends PlatformPcdPreproces
Common function interface for outer.
@param fpdFilePath The fpd file path of current build or processing.
@param messageLevel The message level for this Action.
@throws PlatformPreprocessBuildException
The exception of this function. Because it can *not* be predict
where the action class will be used. So only Exception can be throw.
**/
public void perform(String fpdFilePath, int messageLevel)
public void perform(String fpdFilePath)
throws PlatformPcdPreprocessBuildException {
this.fpdFilePath = fpdFilePath;
setActionMessageLevel(messageLevel);
checkParameter();
execute();
ActionMessage.messageLevel = originalMessageLevel;
}
/**