1 /*
2 * Copyright 2010-2020 Redgate Software Ltd
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.flywaydb.core.internal.logging.slf4j;
17
18 import org.flywaydb.core.api.logging.Log;
19 import org.slf4j.Logger;
20
21 /**
22 * Wrapper for a Slf4j logger.
23 */
24 public class Slf4jLog implements Log {
25 /**
26 * Slf4j Logger.
27 */
28 private final Logger logger;
29
30 /**
31 * Creates a new wrapper around this logger.
32 *
33 * @param logger The original Slf4j Logger.
34 */
35 public Slf4jLog(Logger logger) {
36 this.logger = logger;
37 }
38
39 @Override
40 public boolean isDebugEnabled() {
41 return logger.isDebugEnabled();
42 }
43
44 public void debug(String message) {
45 logger.debug(message);
46 }
47
48 public void info(String message) {
49 logger.info(message);
50 }
51
52 public void warn(String message) {
53 logger.warn(message);
54 }
55
56 public void error(String message) {
57 logger.error(message);
58 }
59
60 public void error(String message, Exception e) {
61 logger.error(message, e);
62 }
63 }