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); }
public static SchemaCrawlerLogger getLogger(final String name) { return new SchemaCrawlerLogger(Logger.getLogger(name)); }
public void log(final Level level, final int depth, final String msg, final Throwable thrown) { requireNonNull(level, "No log level provided"); if (!logger.isLoggable(level)) { return; } final LogRecord lr = new LogRecord(level, msg); updateSource(lr, depth); if (thrown != null) { lr.setThrown(thrown); } logger.log(lr); }
public void log(final Level level, final int depth, final String msg, final Throwable thrown) { requireNonNull(level, "No log level provided"); if (!logger.isLoggable(level)) { return; } final LogRecord lr = new LogRecord(level, msg); updateSource(lr, depth); if (thrown != null) { lr.setThrown(thrown); } logger.log(lr); }
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); }
public static SchemaCrawlerLogger getLogger(final String name) { return new SchemaCrawlerLogger(Logger.getLogger(name)); }
public void log(final Level level, final String msg) { log(level, msg, null); }
public static void logSystemClasspath() { if (!LOGGER.isLoggable(Level.CONFIG)) { return; } LOGGER.log(Level.CONFIG, String.format("Classpath: %n%s", printPath(System.getProperty("java.class.path")))); LOGGER.log(Level.CONFIG, String.format("LD_LIBRARY_PATH: %n%s", printPath(System.getenv("LD_LIBRARY_PATH")))); }
public void log(final Level level, final String msg, final Throwable thrown) { log(level, 0, msg, thrown); }
public static void logSystemClasspath() { if (!LOGGER.isLoggable(Level.CONFIG)) { return; } LOGGER.log(Level.CONFIG, String.format("Classpath: %n%s", printPath(System.getProperty("java.class.path")))); LOGGER.log(Level.CONFIG, String.format("LD_LIBRARY_PATH: %n%s", printPath(System.getenv("LD_LIBRARY_PATH")))); }
public void log(final Level level, final String msg) { log(level, msg, null); }
private void logExecution() { if (LOGGER.isLoggable(Level.INFO)) { LOGGER .log(Level.INFO, String.format("Executing SchemaCrawler command <%s>", command)); if (LOGGER.isLoggable(Level.CONFIG)) { LOGGER.log(Level.CONFIG, String.format("Executable: %s", this.getClass().getName())); LOGGER.log(Level.CONFIG, ObjectToString.toString(schemaCrawlerOptions)); LOGGER.log(Level.CONFIG, ObjectToString.toString(outputOptions)); LOGGER.log(Level.CONFIG, schemaRetrievalOptions.toString()); if (LOGGER.isLoggable(Level.FINE)) { LOGGER.log(Level.FINE, ObjectToString.toString(additionalConfiguration)); } } } }
public void log(final Level level, final String msg, final Throwable thrown) { log(level, 0, msg, thrown); }
private void logConnection(final Connection connection) { if (connection == null || !LOGGER.isLoggable(Level.INFO)) { return; } try { final DatabaseMetaData dbMetaData = connection.getMetaData(); LOGGER .log(Level.INFO, new StringFormat("Connected to %n%s %s %nusing JDBC driver %n%s %s", dbMetaData.getDatabaseProductName(), dbMetaData.getDatabaseProductVersion(), dbMetaData.getDriverName(), dbMetaData.getDriverVersion())); } catch (final SQLException e) { LOGGER.log(Level.WARNING, "Could not log connection information", e); } }
private void showCommandline(final Path outputFile, final List<String> command) { if (!LOGGER.isLoggable(Level.SEVERE)) { return; } // Find name of DOT file in local directory final Path movedDotFile = outputFile.normalize().getParent() .resolve(outputFile.getFileName() + ".dot"); // Print command to run command.remove(command.size() - 1); command.remove(command.size() - 1); command.add(outputFile.toString()); command.add(movedDotFile.toString()); LOGGER.log(Level.SEVERE, String.format("%s%nGenerate your diagram manually, using:%n%s", readResourceFully("/dot.error.txt"), String.join(" ", command))); }
public void log(final Level level, final Supplier<String> msgSupplier) { if (!logger.isLoggable(level)) { return; } log(level, msgSupplier.get()); }
public static void logSystemProperties() { if (!LOGGER.isLoggable(Level.CONFIG)) { return; } final SortedMap<String, String> systemProperties = new TreeMap<>(); for (final Entry<Object, Object> propertyValue: System.getProperties() .entrySet()) { final String name = (String) propertyValue.getKey(); if ((name.startsWith("java.") || name.startsWith("os.")) && !name.endsWith(".path")) { systemProperties.put(name, (String) propertyValue.getValue()); } } LOGGER.log(Level.CONFIG, String.format("System properties: %n%s", join(systemProperties, System.lineSeparator()))); }