oracle.dacf.util.errorloggers
Class StdErrorLogger
java.lang.Object
|
+--oracle.dacf.util.errormanager.ErrorLoggerAdapter
|
+--oracle.dacf.util.errorloggers.StdErrorLogger
- All Implemented Interfaces:
- ErrorLogger
- Direct Known Subclasses:
- StyleStdErrorLogger
- public class StdErrorLogger
- extends ErrorLoggerAdapter
The StdErrorLogger is a non-buffered logger class
that writes error information to stderr. This class extends
ErrorLoggerAdapter, which defines an abstract non-buffered logger, and
provides implementations of the addError and getName methods.
The StdErrorLogger does nothing more than write all errors to stderr.
If you want to use this logger, add the following code to your program.
StdErrorLogger errlog = new StdErrorLogger();
try
{
ErrorManager.addErrorLogger(errlog);
}
catch (NameAlreadyRegisteredException e)
{
System.err.println("A Logger with this
name is already registered.");
return;
}
……………..
……………..
……………..
ErrorManager.removeErrorLogger( errlog);
- See Also:
ErrorLogger
,
ErrorLoggerAdapter
Field Summary |
protected static java.lang.String |
BEGIN_ERROR
|
protected static java.lang.String |
END_ERROR
|
static java.lang.String |
NAME
String returned by the getName() method. |
Method Summary |
protected void |
_printErrorAttribute(ErrorAttribute ea)
Prints the error attribute's label and description, separated
by a colon, to stderr. |
void |
addError(ErrorMessage emsg)
When adding an error, the error severity, message text, and time stamp
will be written to stderr. |
java.lang.String |
getName()
Returns the unique name of this error logger. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NAME
public static java.lang.String NAME
- String returned by the getName() method.
BEGIN_ERROR
protected static java.lang.String BEGIN_ERROR
END_ERROR
protected static java.lang.String END_ERROR
StdErrorLogger
public StdErrorLogger()
addError
public void addError(ErrorMessage emsg)
- When adding an error, the error severity, message text, and time stamp
will be written to stderr.
- Overrides:
addError
in class ErrorLoggerAdapter
- Parameters:
emsg
- the error message.
getName
public java.lang.String getName()
- Returns the unique name of this error logger.
An error logger without a name cannot be registered by the Error Manager.
- Returns:
- the name of this error logger.
_printErrorAttribute
protected void _printErrorAttribute(ErrorAttribute ea)
- Prints the error attribute's label and description, separated
by a colon, to stderr.
- Parameters:
ea
- the error attribute you want printed.