Slf4jLoggerImpl.java

  1. /*
  2.  *    Copyright 2009-2022 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.  *       https://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.apache.ibatis.logging.slf4j;

  17. import org.apache.ibatis.logging.Log;
  18. import org.slf4j.Logger;

  19. /**
  20.  * @author Eduardo Macarron
  21.  */
  22. class Slf4jLoggerImpl implements Log {

  23.   private final Logger log;

  24.   public Slf4jLoggerImpl(Logger logger) {
  25.     log = logger;
  26.   }

  27.   @Override
  28.   public boolean isDebugEnabled() {
  29.     return log.isDebugEnabled();
  30.   }

  31.   @Override
  32.   public boolean isTraceEnabled() {
  33.     return log.isTraceEnabled();
  34.   }

  35.   @Override
  36.   public void error(String s, Throwable e) {
  37.     log.error(s, e);
  38.   }

  39.   @Override
  40.   public void error(String s) {
  41.     log.error(s);
  42.   }

  43.   @Override
  44.   public void debug(String s) {
  45.     log.debug(s);
  46.   }

  47.   @Override
  48.   public void trace(String s) {
  49.     log.trace(s);
  50.   }

  51.   @Override
  52.   public void warn(String s) {
  53.     log.warn(s);
  54.   }

  55. }