View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  
20  package org.apache.myfaces.tobago.util;
21  
22  import org.apache.avalon.framework.logger.Logger;
23  
24  public class Slf4jLogger implements Logger {
25  
26    private org.slf4j.Logger log;
27  
28    public Slf4jLogger(org.slf4j.Logger log) {
29      this.log = log;
30    }
31  
32    public void debug(String reference) {
33      log.debug(reference);
34    }
35  
36    public void debug(String reference, Throwable throwable) {
37      log.debug(reference, throwable);
38    }
39  
40    public boolean isDebugEnabled() {
41      return log.isDebugEnabled();
42    }
43  
44    public void info(String reference) {
45      log.info(reference);
46    }
47  
48    public void info(String reference, Throwable throwable) {
49      log.info(reference, throwable);
50    }
51  
52    public boolean isInfoEnabled() {
53      return log.isInfoEnabled();
54    }
55  
56    public void warn(String reference) {
57      log.warn(reference);
58    }
59  
60    public void warn(String reference, Throwable throwable) {
61      log.warn(reference, throwable);
62    }
63  
64    public boolean isWarnEnabled() {
65      return log.isWarnEnabled();
66    }
67  
68    public void error(String reference) {
69      log.error(reference);
70    }
71  
72    public void error(String reference, Throwable throwable) {
73      log.error(reference, throwable);
74    }
75  
76    public boolean isErrorEnabled() {
77      return log.isErrorEnabled();
78    }
79  
80    public void fatalError(String reference) {
81      log.error(reference);
82    }
83  
84    public void fatalError(String reference, Throwable throwable) {
85      log.error(reference, throwable);
86    }
87  
88    public boolean isFatalErrorEnabled() {
89      return log.isErrorEnabled();
90    }
91  
92    public Logger getChildLogger(String reference) {
93      return null;
94    }
95  }