import java.util.List;
import javax.annotation.CheckForNull;
import javax.annotation.Nullable;
-import org.slf4j.LoggerFactory;
import org.sonar.api.utils.log.Logger;
+import org.sonar.api.utils.log.Loggers;
import static com.google.common.collect.Lists.newArrayList;
try {
connection.close();
} catch (SQLException e) {
- LoggerFactory.getLogger(DatabaseUtils.class).warn("Fail to close connection", e);
+ Loggers.get(DatabaseUtils.class).warn("Fail to close connection", e);
// ignore
}
}
try {
stmt.close();
} catch (SQLException e) {
- LoggerFactory.getLogger(DatabaseUtils.class).warn("Fail to close statement", e);
+ Loggers.get(DatabaseUtils.class).warn("Fail to close statement", e);
// ignore
}
}
try {
rs.close();
} catch (SQLException e) {
- LoggerFactory.getLogger(DatabaseUtils.class).warn("Fail to close result set", e);
+ Loggers.get(DatabaseUtils.class).warn("Fail to close result set", e);
// ignore
}
}
*/
package org.sonar.db;
-import ch.qos.logback.classic.Level;
import com.google.common.io.Closeables;
import java.io.InputStream;
import org.apache.ibatis.builder.xml.XMLMapperBuilder;
import org.apache.ibatis.session.Configuration;
import org.apache.ibatis.transaction.jdbc.JdbcTransactionFactory;
import org.apache.ibatis.type.JdbcType;
-import org.slf4j.LoggerFactory;
+import org.sonar.api.utils.log.LoggerLevel;
+import org.sonar.api.utils.log.Loggers;
import org.sonar.db.dialect.Dialect;
import static com.google.common.base.Preconditions.checkArgument;
private void loadAndConfigureLogger(String mapperName) {
conf.addLoadedResource(mapperName);
- ((ch.qos.logback.classic.Logger) LoggerFactory.getLogger(mapperName)).setLevel(Level.INFO);
+ Loggers.get(mapperName).setLevel(LoggerLevel.INFO);
}
public void loadMappers(Class<?>... mapperClasses) {
import org.apache.ibatis.session.ResultContext;
import org.apache.ibatis.session.ResultHandler;
import org.apache.ibatis.session.SqlSession;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.sonar.api.utils.System2;
+import org.sonar.api.utils.log.Logger;
+import org.sonar.api.utils.log.Loggers;
import org.sonar.db.Dao;
import org.sonar.db.DbSession;
import org.sonar.db.MyBatis;
* @since 2.14
*/
public class PurgeDao implements Dao {
- private static final Logger LOG = LoggerFactory.getLogger(PurgeDao.class);
+ private static final Logger LOG = Loggers.get(PurgeDao.class);
private final MyBatis mybatis;
private final ResourceDao resourceDao;
private final System2 system2;