Class Logging
java.lang.Object
org.noise_planet.noisemodelling.webserver.utilities.Logging
Utility functions related to logging features
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidappendSuppressed(StringBuilder sb, Throwable sup, IdentityHashMap<Throwable, Boolean> seen, String prefix) static voidstatic voidconfigureLoggerFromWorkingDirectory(String workingDirectory, String loggingFileName, boolean verbose) static org.apache.log4j.RollingFileAppendercreateRollingFileAppender(String workingDirectory, String loggingFileName) static StringformatSqlQueryResult(groovy.sql.Sql sql, Object query) Executes a SQL query and return the result set as an ASCII table.static StringformatSqlQueryResult(groovy.sql.Sql sql, Object query, int maxColWidth) Executes a SQL query and return the result set as an ASCII table.static StringformatThrowableAsHtml(Throwable throwable) Build an HTML-friendly stack trace string similar to what SLF4J would print, including the exception type, message, stack frames, causes, and suppressed exceptions.static void
-
Field Details
-
DEFAULT_LOG_FORMAT
- See Also:
-
LOG_PATTERN
-
LINE_SEPARATOR
-
-
Constructor Details
-
Logging
public Logging()
-
-
Method Details
-
initConsoleLogging
public static void initConsoleLogging() -
configureLoggerFromWorkingDirectory
-
clearAppenders
public static void clearAppenders() -
createRollingFileAppender
-
formatThrowableAsHtml
-
appendSuppressed
public static void appendSuppressed(StringBuilder sb, Throwable sup, IdentityHashMap<Throwable, Boolean> seen, String prefix) -
formatSqlQueryResult
-
formatSqlQueryResult
Executes a SQL query and return the result set as an ASCII table.- Parameters:
sql- An instance of groovy.sql.Sqlquery- A String or GString (allows for parameter injection)maxColWidth- Maximum width of a column before truncation
-