View Javadoc
1   package net.sumaris.core.dao.technical.liquibase;
2   
3   /*-
4    * #%L
5    * SUMARiS:: Core shared
6    * %%
7    * Copyright (C) 2018 SUMARiS Consortium
8    * %%
9    * This program is free software: you can redistribute it and/or modify
10   * it under the terms of the GNU General Public License as
11   * published by the Free Software Foundation, either version 3 of the
12   * License, or (at your option) any later version.
13   * 
14   * This program is distributed in the hope that it will be useful,
15   * but WITHOUT ANY WARRANTY; without even the implied warranty of
16   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17   * GNU General Public License for more details.
18   * 
19   * You should have received a copy of the GNU General Public
20   * License along with this program.  If not, see
21   * <http://www.gnu.org/licenses/gpl-3.0.html>.
22   * #L%
23   */
24  
25  import liquibase.logging.LogType;
26  import liquibase.logging.core.AbstractLogger;
27  
28  import org.slf4j.LoggerFactory;
29  
30  /**
31   * Liquibase finds this class by itself by doing a custom component scan (sl4fj wasn't generic enough).
32   */
33  public class Logger extends AbstractLogger {
34  
35      private static final org.slf4j.Logger log = LoggerFactory.getLogger("liquibase");
36  
37      @Override
38      public void severe(LogType logType, String message) {
39          log.error("{} {}", logType.name(), message);
40      }
41  
42      @Override
43      public void severe(LogType logType, String message, Throwable e) {
44          log.error("{} {}", logType.name(), message, e);
45      }
46  
47      @Override
48      public void warning(LogType logType, String message) {
49          log.warn("{} {}", logType.name(), message);
50      }
51  
52      @Override
53      public void warning(LogType logType, String message, Throwable e) {
54          log.warn("{} {}", logType.name(), message, e);
55      }
56  
57      @Override
58      public void info(LogType logType, String message) {
59          log.info("{} {}", logType.name(), message);
60      }
61  
62      @Override
63      public void info(LogType logType, String message, Throwable e) {
64          log.info("{} {}", logType.name(), message, e);
65      }
66  
67      @Override
68      public void debug(LogType logType, String message) {
69          log.debug("{} {}", logType.name(), message);
70      }
71  
72      @Override
73      public void debug(LogType logType, String message, Throwable e) {
74          log.debug("{} {}", logType.name(), message, e);
75      }
76  
77  }