public void log(final Level level, final Supplier<String> msgSupplier) { if (!logger.isLoggable(level)) { return; } log(level, msgSupplier.get()); }
public void log(final Level level, final Supplier<String> msgSupplier, final Throwable thrown) { if (!logger.isLoggable(level)) { return; } log(level, msgSupplier.get(), thrown); }
public void log(final Level level, final Supplier<String> msgSupplier) { if (!logger.isLoggable(level)) { return; } log(level, msgSupplier.get()); }
public void log(final Level level, final Supplier<String> msgSupplier, final Throwable thrown) { if (!logger.isLoggable(level)) { return; } log(level, msgSupplier.get(), thrown); }
public void setPort(final int port) { if (port > 0) { connectionProperties.put(PORT, String.valueOf(port)); } else { LOGGER.log(Level.WARNING, new StringFormat("Cannot connect to port, %d", port)); } }
public static void logFullStackTrace(final Level level, final Throwable t) { if (level == null || !LOGGER.isLoggable(level)) { return; } if (t == null) { return; } LOGGER.log(level, t.getMessage(), t); }
private void logOverride(final String inclusionRuleName, final InclusionRule schemaInclusionRule) { LOGGER .log(Level.INFO, new StringFormat("Overriding %s inclusion rule from command-line to %s", inclusionRuleName, schemaInclusionRule)); }
public static void logFullStackTrace(final Level level, final Throwable t) { if (level == null || !LOGGER.isLoggable(level)) { return; } if (t == null) { return; } LOGGER.log(level, t.getMessage(), t); }
private void logOverride(final String inclusionRuleName, final InclusionRule schemaInclusionRule) { LOGGER .log(Level.INFO, new StringFormat("Overriding %s inclusion rule from command-line to %s", inclusionRuleName, schemaInclusionRule)); }
private FileInputResource(final Path filePath, final boolean allowEmptyFile) throws IOException { inputFile = requireNonNull(filePath, "No file path provided").normalize() .toAbsolutePath(); if (!isFileReadable(inputFile)) { final IOException e = new IOException("Cannot read file, " + inputFile); LOGGER.log(Level.FINE, e.getMessage(), e); throw e; } }
@Override public Writer openNewOutputWriter(final Charset charset, final boolean appendOutput) throws IOException { final Writer writer = new BufferedWriter(new OutputStreamWriter(System.out, charset)); LOGGER.log(Level.INFO, "Opened output writer to console"); return new OutputWriter(getDescription(), writer, false); }
@Override public Reader openNewInputReader(final Charset charset) throws IOException { LOGGER.log(Level.INFO, "Input to provided reader"); return new InputReader(getDescription(), new BufferedReader(reader), false); }
@Override public Writer openNewOutputWriter(final Charset charset, final boolean appendOutput) throws IOException { LOGGER.log(Level.INFO, "Output to provided writer"); return new OutputWriter(getDescription(), new BufferedWriter(writer), false); }
public static long executeForLong(final Query query, final Connection connection, final Table table, final Identifiers identifiers) throws SchemaCrawlerException { requireNonNull(query, "No query provided"); final String sql = getQuery(query, table, true, identifiers); LOGGER.log(Level.FINE, new StringFormat("Executing %s: %n%s", query.getName(), sql)); return executeSqlForLong(connection, sql); }
public static Object executeForScalar(final Query query, final Connection connection, final Table table, final Identifiers identifiers) throws SchemaCrawlerException { requireNonNull(query, "No query provided"); final String sql = getQuery(query, table, true, identifiers); LOGGER.log(Level.FINE, new StringFormat("Executing %s: %n%s", query.getName(), sql)); return executeSqlForScalar(connection, sql); }
public static Object executeForScalar(final Query query, final Connection connection) throws SchemaCrawlerException { requireNonNull(query, "No query provided"); final String sql = getQuery(query); LOGGER.log(Level.FINE, new StringFormat("Executing %s: %n%s", query.getName(), sql)); return executeSqlForScalar(connection, sql); }
public static ResultSet executeAgainstSchema(final Query query, final Statement statement, final InclusionRule schemaInclusionRule) throws SQLException { requireNonNull(query, "No query provided"); final String sql = getQuery(query, schemaInclusionRule); LOGGER.log(Level.FINE, new StringFormat("Executing %s: %n%s", query.getName(), sql)); return executeSql(statement, sql); }
public static ResultSet executeAgainstSchema(final Query query, final Statement statement, final InclusionRule schemaInclusionRule) throws SQLException { requireNonNull(query, "No query provided"); final String sql = getQuery(query, schemaInclusionRule); LOGGER.log(Level.FINE, new StringFormat("Executing %s: %n%s", query.getName(), sql)); return executeSql(statement, sql); }