]>
git.proxmox.com Git - mirror_edk2.git/blob - Tools/Source/Common/org/tianocore/common/logger/EdkLog.java
3 Copyright (c) 2006, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
19 package org
.tianocore
.common
.logger
;
21 import org
.tianocore
.common
.logger
.LogMethod
;
24 private static final String error
= "ERROR";
25 private static final String warning
= "WARNING";
26 private static final String info
= "INFO";
27 private static final String verbose
= "VERBOSE";
28 private static final String debug
= "DEBUG";
30 public static final int EDK_ERROR
= 0;
31 public static final int EDK_WARNING
= 1;
32 public static final int EDK_INFO
= 2;
33 public static final int EDK_VERBOSE
= 3;
34 public static final int EDK_DEBUG
= 4;
36 private static int logLevel
= EDK_INFO
;
37 private static LogMethod logger
= new DefaultLogger();
39 public static void log(int level
, String message
) {
40 if (level
<= logLevel
){
41 logger
.putMessage(null, logLevel
, message
);
46 public static void log(int logLevel
, String message
, Exception cause
) {
50 public static void log(int logLevel
, Exception cause
) {
54 public static void log(Exception cause
) {
58 public static void setLogger(LogMethod l
) {
62 public static void setLogLevel (int level
){
65 public static void setLogLevel (String level
){
69 String levelStr
= level
.trim();
70 if (levelStr
.equalsIgnoreCase(error
)){
73 if (levelStr
.equalsIgnoreCase(debug
)){
76 if (levelStr
.equalsIgnoreCase(info
)){
79 if (levelStr
.equalsIgnoreCase(verbose
)){
80 logLevel
= EDK_VERBOSE
;
82 if (levelStr
.equalsIgnoreCase(warning
)){
83 logLevel
= EDK_WARNING
;
86 public static int getLogLevel (){