1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   *
13   */
14  
15  package com.liferay.portal.kernel.log;
16  
17  import java.util.logging.Level;
18  import java.util.logging.Logger;
19  
20  /**
21   * <a href="Jdk14LogImpl.java.html"><b><i>View Source</i></b></a>
22   *
23   * @author Brian Wing Shun Chan
24   */
25  public class Jdk14LogImpl implements Log {
26  
27      public Jdk14LogImpl(Logger log) {
28          _log = log;
29      }
30  
31      public void debug(Object msg) {
32          _log.log(Level.FINE, msg.toString());
33      }
34  
35      public void debug(Throwable t) {
36          _log.log(Level.FINE, t.getMessage(), t);
37      }
38  
39      public void debug(Object msg, Throwable t) {
40          _log.log(Level.FINE, msg.toString(), t);
41      }
42  
43      public void error(Object msg) {
44          _log.log(Level.SEVERE, msg.toString());
45      }
46  
47      public void error(Throwable t) {
48          _log.log(Level.SEVERE, t.getMessage(), t);
49      }
50  
51      public void error(Object msg, Throwable t) {
52          _log.log(Level.SEVERE, msg.toString(), t);
53      }
54  
55      public void fatal(Object msg) {
56          _log.log(Level.SEVERE, msg.toString());
57      }
58  
59      public void fatal(Throwable t) {
60          _log.log(Level.SEVERE, t.getMessage(), t);
61      }
62  
63      public void fatal(Object msg, Throwable t) {
64          _log.log(Level.SEVERE, msg.toString(), t);
65      }
66  
67      public void info(Object msg) {
68          _log.log(Level.INFO, msg.toString());
69      }
70  
71      public void info(Throwable t) {
72          _log.log(Level.INFO, t.getMessage(), t);
73      }
74  
75      public void info(Object msg, Throwable t) {
76          _log.log(Level.INFO, msg.toString(), t);
77      }
78  
79      public boolean isDebugEnabled() {
80          return _log.isLoggable(Level.FINE);
81      }
82  
83      public boolean isErrorEnabled() {
84          return _log.isLoggable(Level.SEVERE);
85      }
86  
87      public boolean isFatalEnabled() {
88          return _log.isLoggable(Level.SEVERE);
89      }
90  
91      public boolean isInfoEnabled() {
92          return _log.isLoggable(Level.INFO);
93      }
94  
95      public boolean isTraceEnabled() {
96          return _log.isLoggable(Level.FINEST);
97      }
98  
99      public boolean isWarnEnabled() {
100         return _log.isLoggable(Level.WARNING);
101     }
102 
103     public void trace(Object msg) {
104         _log.log(Level.FINEST, msg.toString());
105     }
106 
107     public void trace(Throwable t) {
108         _log.log(Level.FINEST, t.getMessage(), t);
109     }
110 
111     public void trace(Object msg, Throwable t) {
112         _log.log(Level.FINEST, msg.toString(), t);
113     }
114 
115     public void warn(Object msg) {
116         _log.log(Level.WARNING, msg.toString());
117     }
118 
119     public void warn(Throwable t) {
120         _log.log(Level.WARNING, t.getMessage(), t);
121     }
122 
123     public void warn(Object msg, Throwable t) {
124         _log.log(Level.WARNING, msg.toString(), t);
125     }
126 
127     private Logger _log;
128 
129 }