public final class Exceptions extends Object
Modifier and Type | Method and Description |
---|---|
static void |
error(Object source,
Throwable exception)
Log exception in a compact syslog-friendly format with ERROR log level.
|
static char |
escape(char chr)
Escape one character.
|
static String |
escape(String text)
Escape all toxic characters (they are not suitable for XML documents).
|
static void |
info(Object source,
Throwable exception)
Log exception in a compact syslog-friendly format with INFO log level.
|
static String |
message(Throwable exception)
Get exception message by composing messages of chained exceptions.
|
static String |
stacktrace(Throwable exception)
Get clean version of exception stacktrace.
|
static void |
warn(Object source,
Throwable exception)
Log exception in a compact syslog-friendly format with WARN log level.
|
public static void info(Object source, Throwable exception)
source
- Source of exception.exception
- Throwable to log.public static void warn(Object source, Throwable exception)
source
- Source of exception.exception
- Throwable to log.public static void error(Object source, Throwable exception)
source
- Source of exception.exception
- Throwable to log.public static String message(Throwable exception)
exception
- Throwable from which to retrieve messages.public static String stacktrace(Throwable exception)
exception
- Throwable for stacktrace cleanup.public static String escape(String text)
text
- Text to escapepublic static char escape(char chr)
chr
- Char to escapeCopyright © 2009–2014 Rultor Inc.. All rights reserved.