public final class ExceptionRecorder extends Object
ExceptionRecorder provides a function to record an exception to a file along with the trace data if active.
Modifier and Type | Field and Description |
---|---|
(package private) static String |
FILE_HEADER
File header constant
|
(package private) static String |
INFORMATION_UNAVAILABLE
Information not available constant
|
(package private) static String |
RUN_JDK
Run line jdk constant
|
(package private) static String |
RUN_SYSTEM
Run line system constant
|
Modifier and Type | Method and Description |
---|---|
File |
getExceptionDirectory()
Returns the directory to which the exceptions are written.
|
protected String |
getUniqueName(String prefix)
Gets a unique file name.
|
static ExceptionRecorder |
instance()
Gets the shared instance of the ExceptionRecorder.
|
String |
record(String errorMessage,
Throwable throwable)
Writes out the exception to a file along with trace data if active.
|
String |
record(String message,
Throwable throwable,
String prefix)
Writes out the exception to a file along with trace data if active.
|
String |
record(Throwable throwable)
Writes out the exception to a file along with trace data if active.
|
static final String FILE_HEADER
static final String RUN_SYSTEM
static final String RUN_JDK
static final String INFORMATION_UNAVAILABLE
public static ExceptionRecorder instance()
public String record(Throwable throwable)
Writes out the exception to a file along with trace data if active. The file name is of the form sYYMMDDHHMMSS (_nn).exc where YY..SS is the timestamp (_nn) is an ascending sequence number when multiple exceptions occur in the same second. Returns the filename of the generated exception report.
throwable
- to record.public String record(String errorMessage, Throwable throwable)
Writes out the exception to a file along with trace data if active. The file name is of the form sYYMMDDHHMMSS (_nn).exc where YY..SS is the timestamp (_nn) is an ascending sequence number when multiple exceptions occur in the same second. Returns the filename of the generated exception report.
errorMessage
- to log with the exception report.throwable
- to record.public String record(String message, Throwable throwable, String prefix)
Writes out the exception to a file along with trace data if active. The file name is of the form sYYMMDDHHMMSS (_nn).exc where YY..SS is the timestamp <_nn>is an ascending sequence number when multiple exceptions occur in the same second.
message
- diagnostic messagethrowable
- exception to record.prefix
- for the file name.protected String getUniqueName(String prefix)
prefix
- public File getExceptionDirectory()
Copyright © 2003–2014 AndroMDA.org. All rights reserved.