Fixed EDKT370&372

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1709 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
qouyang
2006-10-10 14:48:17 +00:00
parent de50890e70
commit a06a54171d
3 changed files with 43 additions and 13 deletions

View File

@ -110,6 +110,7 @@ public class FrameworkBuildTask extends Task{
// set Logger // set Logger
// //
GenBuildLogger logger = new GenBuildLogger(getProject()); GenBuildLogger logger = new GenBuildLogger(getProject());
EdkLog.setLogLevel(EdkLog.EDK_DEBUG);
EdkLog.setLogLevel(getProject().getProperty("env.LOGLEVEL")); EdkLog.setLogLevel(getProject().getProperty("env.LOGLEVEL"));
EdkLog.setLogger(logger); EdkLog.setLogger(logger);

View File

@ -44,7 +44,10 @@ import org.tianocore.common.logger.LogMethod;
public class GenBuildLogger extends DefaultLogger implements LogMethod { public class GenBuildLogger extends DefaultLogger implements LogMethod {
Project project = null; Project project = null;
///
/// Time of the start of the build
///
private long startTime = System.currentTimeMillis();
/// ///
/// flag to present whether cache all msg or not /// flag to present whether cache all msg or not
/// true means to cache. /// true means to cache.
@ -76,7 +79,6 @@ public class GenBuildLogger extends DefaultLogger implements LogMethod {
if (this.project == null) { if (this.project == null) {
return; return;
} }
// //
// If msgLevel is always print, then print it // If msgLevel is always print, then print it
// //
@ -96,7 +98,7 @@ public class GenBuildLogger extends DefaultLogger implements LogMethod {
case EdkLog.EDK_INFO: case EdkLog.EDK_INFO:
log(msgSource, msg, Project.MSG_INFO); log(msgSource, msg, Project.MSG_INFO);
break; break;
case EdkLog.EDK_VERBOSE: case EdkLog.EDK_VERBOSE:
log(msgSource, msg, Project.MSG_VERBOSE); log(msgSource, msg, Project.MSG_VERBOSE);
break; break;
case EdkLog.EDK_DEBUG: case EdkLog.EDK_DEBUG:
@ -179,10 +181,7 @@ public class GenBuildLogger extends DefaultLogger implements LogMethod {
} }
public void messageLogged(BuildEvent event) { public void messageLogged(BuildEvent event) {
if (!enableFlag) { int currentLevel = event.getPriority();
return ;
}
int currentLevel = event.getPriority();
// //
// If current level is upper than Ant Level, skip it // If current level is upper than Ant Level, skip it
// //
@ -271,4 +270,40 @@ public class GenBuildLogger extends DefaultLogger implements LogMethod {
public void setId(FpdModuleIdentification id) { public void setId(FpdModuleIdentification id) {
this.id = id; this.id = id;
} }
public void buildFinished(BuildEvent event) {
Throwable error = event.getException();
StringBuffer message = new StringBuffer();
if (error == null) {
message.append(StringUtils.LINE_SEP);
message.append("BUILD SUCCESSFUL");
} else {
message.append(StringUtils.LINE_SEP);
message.append("BUILD FAILED");
message.append(StringUtils.LINE_SEP);
if (Project.MSG_DEBUG <= msgOutputLevel
|| !(error instanceof BuildException)) {
message.append(StringUtils.getStackTrace(error));
} else {
if (error instanceof BuildException) {
message.append(error.toString()).append(lSep);
} else {
message.append(error.getMessage()).append(lSep);
}
}
}
message.append(StringUtils.LINE_SEP);
message.append("Total time: ");
message.append(formatTime(System.currentTimeMillis() - startTime));
String msg = message.toString();
if (error == null) {
printMessage(msg, out, Project.MSG_VERBOSE);
} else {
printMessage(msg, err, Project.MSG_ERR);
}
log(msg);
}
} }

View File

@ -1828,9 +1828,6 @@ public class SurfaceAreaQuery {
guidPair[0] = entry.getCName(); guidPair[0] = entry.getCName();
guidPair[1] = entry.getGuidValue(); guidPair[1] = entry.getGuidValue();
guidDeclMap.put(entry.getCName(), guidPair); guidDeclMap.put(entry.getCName(), guidPair);
EdkLog.log(EdkLog.EDK_VERBOSE, entry.getName());
EdkLog.log(EdkLog.EDK_VERBOSE, guidPair[0]);
EdkLog.log(EdkLog.EDK_VERBOSE, guidPair[1]);
} }
return guidDeclMap; return guidDeclMap;
} }
@ -1859,9 +1856,6 @@ public class SurfaceAreaQuery {
protocolPair[0] = entry.getCName(); protocolPair[0] = entry.getCName();
protocolPair[1] = entry.getGuidValue(); protocolPair[1] = entry.getGuidValue();
protoclMap.put(entry.getCName(), protocolPair); protoclMap.put(entry.getCName(), protocolPair);
EdkLog.log(EdkLog.EDK_VERBOSE, entry.getName());
EdkLog.log(EdkLog.EDK_VERBOSE, protocolPair[0]);
EdkLog.log(EdkLog.EDK_VERBOSE, protocolPair[1]);
} }
return protoclMap; return protoclMap;
} }