]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/Common/org/tianocore/logger/DefaultLogger.java
Add log and exception mechanism
[mirror_edk2.git] / Tools / Source / Common / org / tianocore / logger / DefaultLogger.java
diff --git a/Tools/Source/Common/org/tianocore/logger/DefaultLogger.java b/Tools/Source/Common/org/tianocore/logger/DefaultLogger.java
new file mode 100644 (file)
index 0000000..4bec8e5
--- /dev/null
@@ -0,0 +1,36 @@
+/*++\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
+Module Name:\r
+  DefaultLogger.java\r
+\r
+Abstract:\r
+\r
+--*/\r
+\r
+package org.tianocore.logger;\r
+import java.util.logging.Level;\r
+import java.util.logging.Logger;\r
+\r
+class DefaultLogger implements LogMethod {\r
+    private Logger logger = Logger.global;\r
+    private static Level[] levelMap = {\r
+        Level.SEVERE, Level.WARNING, Level.INFO, Level.FINE, Level.ALL\r
+    };\r
+\r
+    public DefaultLogger() {\r
+\r
+    }\r
+\r
+    public void putMessage(Object msgSource, int msgLevel, String msg) {\r
+        logger.log(levelMap[msgLevel], msg);\r
+    }\r
+}
\ No newline at end of file