001: /**
002: * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
003: *
004: * Permission is hereby granted, free of charge, to any person obtaining a copy
005: * of this software and associated documentation files (the "Software"), to deal
006: * in the Software without restriction, including without limitation the rights
007: * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
008: * copies of the Software, and to permit persons to whom the Software is
009: * furnished to do so, subject to the following conditions:
010: *
011: * The above copyright notice and this permission notice shall be included in
012: * all copies or substantial portions of the Software.
013: *
014: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
015: * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
016: * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
017: * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
018: * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
019: * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
020: * SOFTWARE.
021: */package com.liferay.portal.kernel.log;
022:
023: import java.util.logging.Level;
024: import java.util.logging.Logger;
025:
026: /**
027: * <a href="Jdk14LogImpl.java.html"><b><i>View Source</i></b></a>
028: *
029: * @author Brian Wing Shun Chan
030: *
031: */
032: public class Jdk14LogImpl implements Log {
033:
034: public Jdk14LogImpl(Logger log) {
035: _log = log;
036: }
037:
038: public void debug(Object msg) {
039: _log.log(Level.FINE, msg.toString());
040: }
041:
042: public void debug(Throwable t) {
043: _log.log(Level.FINE, t.getMessage(), t);
044: }
045:
046: public void debug(Object msg, Throwable t) {
047: _log.log(Level.FINE, msg.toString(), t);
048: }
049:
050: public void error(Object msg) {
051: _log.log(Level.SEVERE, msg.toString());
052: }
053:
054: public void error(Throwable t) {
055: _log.log(Level.SEVERE, t.getMessage(), t);
056: }
057:
058: public void error(Object msg, Throwable t) {
059: _log.log(Level.SEVERE, msg.toString(), t);
060: }
061:
062: public void fatal(Object msg) {
063: _log.log(Level.SEVERE, msg.toString());
064: }
065:
066: public void fatal(Throwable t) {
067: _log.log(Level.SEVERE, t.getMessage(), t);
068: }
069:
070: public void fatal(Object msg, Throwable t) {
071: _log.log(Level.SEVERE, msg.toString(), t);
072: }
073:
074: public void info(Object msg) {
075: _log.log(Level.INFO, msg.toString());
076: }
077:
078: public void info(Throwable t) {
079: _log.log(Level.INFO, t.getMessage(), t);
080: }
081:
082: public void info(Object msg, Throwable t) {
083: _log.log(Level.INFO, msg.toString(), t);
084: }
085:
086: public boolean isDebugEnabled() {
087: return _log.isLoggable(Level.FINE);
088: }
089:
090: public boolean isErrorEnabled() {
091: return _log.isLoggable(Level.SEVERE);
092: }
093:
094: public boolean isFatalEnabled() {
095: return _log.isLoggable(Level.SEVERE);
096: }
097:
098: public boolean isInfoEnabled() {
099: return _log.isLoggable(Level.INFO);
100: }
101:
102: public boolean isTraceEnabled() {
103: return _log.isLoggable(Level.FINEST);
104: }
105:
106: public boolean isWarnEnabled() {
107: return _log.isLoggable(Level.WARNING);
108: }
109:
110: public void trace(Object msg) {
111: _log.log(Level.FINEST, msg.toString());
112: }
113:
114: public void trace(Throwable t) {
115: _log.log(Level.FINEST, t.getMessage(), t);
116: }
117:
118: public void trace(Object msg, Throwable t) {
119: _log.log(Level.FINEST, msg.toString(), t);
120: }
121:
122: public void warn(Object msg) {
123: _log.log(Level.WARNING, msg.toString());
124: }
125:
126: public void warn(Throwable t) {
127: _log.log(Level.WARNING, t.getMessage(), t);
128: }
129:
130: public void warn(Object msg, Throwable t) {
131: _log.log(Level.WARNING, msg.toString(), t);
132: }
133:
134: private Logger _log;
135:
136: }
|