01: //========================================================================
02: //$Id: JettyLog.java 1106 2006-10-17 17:00:06Z janb $
03: //Copyright 2006 Mort Bay Consulting Pty. Ltd.
04: //------------------------------------------------------------------------
05: //Licensed under the Apache License, Version 2.0 (the "License");
06: //you may not use this file except in compliance with the License.
07: //You may obtain a copy of the License at
08: //http://www.apache.org/licenses/LICENSE-2.0
09: //Unless required by applicable law or agreed to in writing, software
10: //distributed under the License is distributed on an "AS IS" BASIS,
11: //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12: //See the License for the specific language governing permissions and
13: //limitations under the License.
14: //========================================================================
15:
16: package com.sun.org.apache.commons.logging;
17:
18: /**
19: * Log
20: *
21: * Bridges the com.sun.org.apache.commons.logging.Log to Jetty's log.
22: *
23: **/
24: public class JettyLog implements Log {
25: private String _name;
26: private org.mortbay.log.Logger _logger;
27:
28: /**
29: *
30: */
31: public JettyLog(String name) {
32: _name = name;
33: _logger = org.mortbay.log.Log.getLogger(name);
34: }
35:
36: public void fatal(Object message) {
37: _logger.warn(message.toString(), null, null);
38: }
39:
40: public void fatal(Object message, Throwable t) {
41: _logger.warn(message.toString(), t);
42: }
43:
44: public void debug(Object message) {
45: _logger.debug(message.toString(), null);
46: }
47:
48: public void debug(Object message, Throwable t) {
49: _logger.debug(message.toString(), t);
50: }
51:
52: public void trace(Object message) {
53: _logger.debug(message.toString(), null);
54: }
55:
56: public void info(Object message) {
57: _logger.info(message.toString(), null, null);
58: }
59:
60: public void error(Object message) {
61: _logger.warn(message.toString(), null);
62: }
63:
64: public void error(Object message, Throwable cause) {
65: _logger.warn(message.toString(), cause);
66: }
67:
68: public void warn(Object message) {
69: _logger.warn(message.toString(), null);
70: }
71:
72: public boolean isDebugEnabled() {
73: return _logger.isDebugEnabled();
74: }
75:
76: public boolean isWarnEnabled() {
77: return _logger.isDebugEnabled();
78: }
79:
80: public boolean isInfoEnabled() {
81: return true;
82: }
83:
84: public boolean isErrorEnabled() {
85: return true;
86: }
87:
88: public boolean isTraceEnabled() {
89: return _logger.isDebugEnabled();
90: }
91:
92: }
|