KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > commons > transaction > util > Jdk14Logger


1 /*
2  * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//transaction/src/java/org/apache/commons/transaction/util/Jdk14Logger.java,v 1.1 2004/11/18 23:27:18 ozeigermann Exp $
3 <<<<<<< .mine
4  * $Revision: 1.1 $
5  * $Date: 2005-02-26 14:16:14 +0100 (Sa, 26 Feb 2005) $
6 =======
7  * $Revision$
8  * $Date: 2005-02-26 14:16:14 +0100 (Sa, 26 Feb 2005) $
9 >>>>>>> .r168169
10  *
11  * ====================================================================
12  *
13  * Copyright 1999-2002 The Apache Software Foundation
14  *
15  * Licensed under the Apache License, Version 2.0 (the "License");
16  * you may not use this file except in compliance with the License.
17  * You may obtain a copy of the License at
18  *
19  * http://www.apache.org/licenses/LICENSE-2.0
20  *
21  * Unless required by applicable law or agreed to in writing, software
22  * distributed under the License is distributed on an "AS IS" BASIS,
23  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
24  * See the License for the specific language governing permissions and
25  * limitations under the License.
26  *
27  */

28
29 package org.apache.commons.transaction.util;
30
31 import java.util.logging.Level JavaDoc;
32 import java.util.logging.Logger JavaDoc;
33
34 /**
35  * Default logger implementation. Uses java.util.logging implementation provided by Java 1.4.
36  *
37  * @version $Revision$
38  */

39 public class Jdk14Logger implements LoggerFacade {
40
41     protected Logger JavaDoc logger;
42
43     public Jdk14Logger(Logger JavaDoc logger) {
44         this.logger = logger;
45     }
46
47     public Logger JavaDoc getLogger() {
48         return logger;
49     }
50
51     public LoggerFacade createLogger(String JavaDoc name) {
52         return new Jdk14Logger(Logger.getLogger(name));
53     }
54
55     public void logInfo(String JavaDoc message) {
56         logger.info(message);
57     }
58
59     public void logFine(String JavaDoc message) {
60         logger.fine(message);
61     }
62
63     public boolean isFineEnabled() {
64         return logger.isLoggable(Level.FINE);
65     }
66
67     public void logFiner(String JavaDoc message) {
68         logger.finer(message);
69     }
70
71     public boolean isFinerEnabled() {
72         return logger.isLoggable(Level.FINER);
73     }
74
75     public void logFinest(String JavaDoc message) {
76         logger.finest(message);
77     }
78
79     public boolean isFinestEnabled() {
80         return logger.isLoggable(Level.FINEST);
81     }
82
83     public void logWarning(String JavaDoc message) {
84         logger.warning(message);
85     }
86
87     public void logWarning(String JavaDoc message, Throwable JavaDoc t) {
88         logger.log(Level.WARNING, message, t);
89     }
90
91     public void logSevere(String JavaDoc message) {
92         logger.severe(message);
93     }
94
95     public void logSevere(String JavaDoc message, Throwable JavaDoc t) {
96         logger.log(Level.SEVERE, message, t);
97     }
98
99 }
100
Popular Tags