public class GenBuildLogger extends DefaultLogger implements LogMethod {\r
\r
Project project = null;\r
-\r
+ \r
+ ///\r
+ /// Time of the start of the build \r
+ ///\r
+ private long startTime = System.currentTimeMillis();\r
+ \r
///\r
/// flag to present whether cache all msg or not\r
/// true means to cache.\r
///\r
private static boolean flag = false;\r
- \r
- private static boolean enableFlag = true;\r
\r
private static Map<FpdModuleIdentification, List<String>> map = new LinkedHashMap<FpdModuleIdentification, List<String> >(256);\r
\r
private FpdModuleIdentification id = null;\r
+ //\r
+ // semaroph for multi thread\r
+ // \r
+ public static Object semaphore = new Object();\r
\r
public GenBuildLogger () {\r
\r
}\r
\r
public void messageLogged(BuildEvent event) {\r
- if (!enableFlag) {\r
- return ;\r
- }\r
+ \r
int currentLevel = event.getPriority();\r
//\r
// If current level is upper than Ant Level, skip it\r
flag = enable;\r
}\r
\r
- public static void maskAllLog(boolean enable) {\r
- enableFlag = !enable;\r
- }\r
- \r
protected synchronized void log(String message) {\r
//\r
// cache log\r
public void setId(FpdModuleIdentification id) {\r
this.id = id;\r
}\r
+\r
+ public void buildFinished(BuildEvent event) {\r
+ if (this.msgOutputLevel >= Project.MSG_VERBOSE) {\r
+ int level = this.msgOutputLevel;\r
+ synchronized(semaphore){\r
+ this.msgOutputLevel = this.msgOutputLevel - 1;\r
+ super.buildFinished(event);\r
+ this.msgOutputLevel = level;\r
+ }\r
+ } else {\r
+ super.buildFinished(event);\r
+ }\r
+ }\r
}
\ No newline at end of file