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