public abstract class ThrowableFormatter
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
FULL_STACK |
Constructor and Description |
---|
ThrowableFormatter() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
format(java.lang.String sMsg,
java.lang.Throwable e)
Formats exception with custom message, current thread name
and full stack trace.
|
static java.lang.String |
format(java.lang.String sMsg,
java.lang.Throwable e,
int nStackDepth)
Formats exception with custom message, current thread name
and specified stack trace depth.
|
static java.lang.String |
format(java.lang.String sMsg,
java.lang.Throwable e,
int nStackDepth,
java.lang.Thread t)
Formats exception with custom message, thread name (if not null)
and specified stack depth.
|
static java.lang.String |
format(java.lang.String sMsg,
java.lang.Throwable e,
java.lang.Thread t)
Formats exception with custom message, thread name
and full stack trace.
|
static java.lang.String |
format(java.lang.Throwable t)
Formats exception with full stack trace without custom message and without thread name.
|
static java.lang.String |
format(java.lang.Throwable t,
int nStackDepth)
Formats exception without custom message and without thread name.
|
static java.lang.String |
formatFriendly(java.lang.Throwable t)
Formats exception in friendly format (messages only).
|
static java.lang.String |
toHtml(java.lang.String s)
Converts a string to html format by replacing newline symbols
to <br> and space symbols to < >.
|
public static final int FULL_STACK
public static final java.lang.String format(java.lang.String sMsg, java.lang.Throwable e, java.lang.Thread t)
sMsg
- custom messaget
- thread with exceptione
- exceptionpublic static final java.lang.String format(java.lang.String sMsg, java.lang.Throwable e)
sMsg
- custom messagee
- exceptionpublic static final java.lang.String format(java.lang.String sMsg, java.lang.Throwable e, int nStackDepth)
sMsg
- custom messagee
- exceptionnStackDepth
- trace stack depth:
FULL_STACK
- to format with full trace stack
0 - to format with "exception class + message"public static final java.lang.String format(java.lang.String sMsg, java.lang.Throwable e, int nStackDepth, java.lang.Thread t)
sMsg
- custom messaget
- thread with exceptione
- exceptionnStackDepth
- trace stack depth:
FULL_STACK
- to format with full trace stack
0 - to format with "exception class + message"public static final java.lang.String format(java.lang.Throwable t)
t
- exceptionpublic static final java.lang.String format(java.lang.Throwable t, int nStackDepth)
t
- exceptionnStackDepth
- trace stack depth:
FULL_STACK
- to format with full trace stack
0 - to format with "exception class + message"public static final java.lang.String formatFriendly(java.lang.Throwable t)
t
- exceptionpublic static java.lang.String toHtml(java.lang.String s)
s
- input string.