1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    *
5    *
6    *
7    * The contents of this file are subject to the terms of the Liferay Enterprise
8    * Subscription License ("License"). You may not use this file except in
9    * compliance with the License. You can obtain a copy of the License by
10   * contacting Liferay, Inc. See the License for the specific language governing
11   * permissions and limitations under the License, including but not limited to
12   * distribution rights of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portal.kernel.log;
24  
25  import java.util.logging.Level;
26  import java.util.logging.Logger;
27  
28  /**
29   * <a href="Jdk14LogImpl.java.html"><b><i>View Source</i></b></a>
30   *
31   * @author Brian Wing Shun Chan
32   */
33  public class Jdk14LogImpl implements Log {
34  
35      public Jdk14LogImpl(Logger log) {
36          _log = log;
37      }
38  
39      public void debug(Object msg) {
40          _log.log(Level.FINE, msg.toString());
41      }
42  
43      public void debug(Throwable t) {
44          _log.log(Level.FINE, t.getMessage(), t);
45      }
46  
47      public void debug(Object msg, Throwable t) {
48          _log.log(Level.FINE, msg.toString(), t);
49      }
50  
51      public void error(Object msg) {
52          _log.log(Level.SEVERE, msg.toString());
53      }
54  
55      public void error(Throwable t) {
56          _log.log(Level.SEVERE, t.getMessage(), t);
57      }
58  
59      public void error(Object msg, Throwable t) {
60          _log.log(Level.SEVERE, msg.toString(), t);
61      }
62  
63      public void fatal(Object msg) {
64          _log.log(Level.SEVERE, msg.toString());
65      }
66  
67      public void fatal(Throwable t) {
68          _log.log(Level.SEVERE, t.getMessage(), t);
69      }
70  
71      public void fatal(Object msg, Throwable t) {
72          _log.log(Level.SEVERE, msg.toString(), t);
73      }
74  
75      public void info(Object msg) {
76          _log.log(Level.INFO, msg.toString());
77      }
78  
79      public void info(Throwable t) {
80          _log.log(Level.INFO, t.getMessage(), t);
81      }
82  
83      public void info(Object msg, Throwable t) {
84          _log.log(Level.INFO, msg.toString(), t);
85      }
86  
87      public boolean isDebugEnabled() {
88          return _log.isLoggable(Level.FINE);
89      }
90  
91      public boolean isErrorEnabled() {
92          return _log.isLoggable(Level.SEVERE);
93      }
94  
95      public boolean isFatalEnabled() {
96          return _log.isLoggable(Level.SEVERE);
97      }
98  
99      public boolean isInfoEnabled() {
100         return _log.isLoggable(Level.INFO);
101     }
102 
103     public boolean isTraceEnabled() {
104         return _log.isLoggable(Level.FINEST);
105     }
106 
107     public boolean isWarnEnabled() {
108         return _log.isLoggable(Level.WARNING);
109     }
110 
111     public void trace(Object msg) {
112         _log.log(Level.FINEST, msg.toString());
113     }
114 
115     public void trace(Throwable t) {
116         _log.log(Level.FINEST, t.getMessage(), t);
117     }
118 
119     public void trace(Object msg, Throwable t) {
120         _log.log(Level.FINEST, msg.toString(), t);
121     }
122 
123     public void warn(Object msg) {
124         _log.log(Level.WARNING, msg.toString());
125     }
126 
127     public void warn(Throwable t) {
128         _log.log(Level.WARNING, t.getMessage(), t);
129     }
130 
131     public void warn(Object msg, Throwable t) {
132         _log.log(Level.WARNING, msg.toString(), t);
133     }
134 
135     private Logger _log;
136 
137 }