1 /**
2 * Copyright 2006-2016 the original author or authors.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 package org.mybatis.generator.logging;
17
18 import org.apache.log4j.Logger;
19
20 /**
21 *
22 * @author Clinton Begin
23 *
24 */
25 public class Log4jImpl implements Log {
26
27 private Logger log;
28
29 public Log4jImpl(Class<?> clazz) {
30 log = Logger.getLogger(clazz);
31 }
32
33 public boolean isDebugEnabled() {
34 return log.isDebugEnabled();
35 }
36
37 public void error(String s, Throwable e) {
38 log.error(s, e);
39 }
40
41 public void error(String s) {
42 log.error(s);
43 }
44
45 public void debug(String s) {
46 log.debug(s);
47 }
48
49 public void warn(String s) {
50 log.warn(s);
51 }
52 }