-/** @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