diff options
Diffstat (limited to 'Tools/Java/Source/Common/org/tianocore/common/logger')
3 files changed, 0 insertions, 183 deletions
diff --git a/Tools/Java/Source/Common/org/tianocore/common/logger/DefaultLogger.java b/Tools/Java/Source/Common/org/tianocore/common/logger/DefaultLogger.java deleted file mode 100644 index b1d9d6de85..0000000000 --- a/Tools/Java/Source/Common/org/tianocore/common/logger/DefaultLogger.java +++ /dev/null @@ -1,44 +0,0 @@ -/*++
-
-Copyright (c) 2006, Intel Corporation
-All rights reserved. This program and the accompanying materials
-are licensed and made available under the terms and conditions of the BSD License
-which accompanies this distribution. The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-Module Name:
- DefaultLogger.java
-
-Abstract:
-
---*/
-
-package org.tianocore.common.logger;
-
-import java.io.File;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-class DefaultLogger implements LogMethod {
- private Logger logger = Logger.global;
- private static Level[] levelMap = {
- Level.SEVERE, Level.WARNING, Level.INFO, Level.FINE, Level.ALL
- };
-
- public DefaultLogger() {
- }
-
- public void putMessage(Object msgSource, int msgLevel, String msg) {
- if (msgLevel < 0 || msgLevel > levelMap.length) {
- msgLevel = 2;
- }
- logger.log(levelMap[msgLevel], msg);
- }
-
- public void flushToFile(File file){
-
- }
-}
\ No newline at end of file diff --git a/Tools/Java/Source/Common/org/tianocore/common/logger/EdkLog.java b/Tools/Java/Source/Common/org/tianocore/common/logger/EdkLog.java deleted file mode 100644 index 6b3ed95471..0000000000 --- a/Tools/Java/Source/Common/org/tianocore/common/logger/EdkLog.java +++ /dev/null @@ -1,112 +0,0 @@ -/*++
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- Module Name:
- EdkLogger.java
-
- Abstract:
-
- --*/
-package org.tianocore.common.logger;
-
-import java.io.File;
-
-public class EdkLog {
- public static final String always = "ALWAYS";
-
- public static final String error = "ERROR";
-
- public static final String warning = "WARNING";
-
- public static final String info = "INFO";
-
- public static final String verbose = "VERBOSE";
-
- public static final String debug = "DEBUG";
-
- public static final int EDK_ALWAYS = -1;
-
- public static final int EDK_ERROR = 0;
-
- public static final int EDK_WARNING = 1;
-
- public static final int EDK_INFO = 2;
-
- public static final int EDK_VERBOSE = 3;
-
- public static final int EDK_DEBUG = 4;
-
- private static int logLevel = EDK_INFO;
-
- private static LogMethod logger = new DefaultLogger();
-
- public static void log(int level, String message) {
- if (level <= logLevel) {
- logger.putMessage(null, level, message);
- }
- }
-
- public static void log(String message) {
- if (EDK_INFO <= logLevel) {
- logger.putMessage(null, EDK_INFO, message);
- }
- }
-
- public static void log(Object o, int level, String message) {
- if (level <= logLevel) {
- logger.putMessage(o, level, message);
- }
- }
-
- public static void log(Object o, String message) {
- if (EDK_INFO <= logLevel) {
- logger.putMessage(o, EDK_INFO, message);
- }
- }
-
- public static void flushLogToFile(File file) {
- logger.flushToFile(file);
- }
-
- public static void setLogger(LogMethod l) {
- logger = l;
- }
-
- public static void setLogLevel(int level) {
- logLevel = level;
- }
-
- public static void setLogLevel(String level) {
- if (level == null) {
- return;
- }
- String levelStr = level.trim();
- if (levelStr.equalsIgnoreCase(error)) {
- logLevel = EDK_ERROR;
- }
- if (levelStr.equalsIgnoreCase(debug)) {
- logLevel = EDK_DEBUG;
- }
- if (levelStr.equalsIgnoreCase(info)) {
- logLevel = EDK_INFO;
- }
- if (levelStr.equalsIgnoreCase(verbose)) {
- logLevel = EDK_VERBOSE;
- }
- if (levelStr.equalsIgnoreCase(warning)) {
- logLevel = EDK_WARNING;
- }
- }
-
- public static int getLogLevel() {
- return logLevel;
- }
-}
diff --git a/Tools/Java/Source/Common/org/tianocore/common/logger/LogMethod.java b/Tools/Java/Source/Common/org/tianocore/common/logger/LogMethod.java deleted file mode 100644 index f9a6802430..0000000000 --- a/Tools/Java/Source/Common/org/tianocore/common/logger/LogMethod.java +++ /dev/null @@ -1,27 +0,0 @@ -/*++
-
- Copyright (c) 2006, Intel Corporation
- All rights reserved. This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
- Module Name:
- LogMethod.java
-
- Abstract:
-
- --*/
-
-package org.tianocore.common.logger;
-
-import java.io.File;
-
-public interface LogMethod {
- public void putMessage(Object msgSource, int msgLevel, String msg);
-
- public void flushToFile(File file);
-}
|