logger
METHOD |
DESCRIPTION |
void info( String text ) |
Sends the text to the Owl log window. The text is preceded
by: "INFO - ". |
void error( String text ) |
Sends the text to the Owl log window. The text is preceded
by: "ERROR - ". Also prints a
stack trace. |
void error( Exception e ) |
Prints any message contained with the exception and then
prints a stack trace. |
void warn( String text ) |
Sends the text to the Owl log window. The text is preceded
by: "WARN - ". |
void debug( String text ) |
Sends the text to the Owl log window. The text is preceded
by: "DEBUG - ". |
void startInfo( String text ) |
Sends the text to the Owl log window. The text is preceded
by: INFO - and ended with: " ... ". Used to wrap a
message around a command. Should be closed with a call to
endInfo() or failInfo(). |
void endInfo() |
Closes the preceding startInfo() method call by placing
a "done." after the " ... " sequence. Represents a successful
completion of the code between startInfo() and endInfo(). |
void failInfo() |
Closes the preceding startInfo() method call by placing
a "failed!" after the
" ... " sequence. Represents a failure of the code between
startInfo() and failInfo(). |
Built in class that all scripts have direct access to and
allows log (info/warning/error/debug) messages to be sent
to the Owl log window. The class should not be instantiated,
as it already is. It can just be used.
Example:
logger.info( "Hello info message!" );
logger.warn( "Hello warning message!" );
logger.error( "Hello error message!" );
logger.debug( "Hello debug message!" );
try
{
logger.startInfo( "Sending a command" );
... do something here ...
logger.endInfo();
}
catch ( Exception e )
{
logger.failInfo();
logger.error( e );
}
The above example will produce the following:
INFO - Hello info message!
WARN - Hello warning message!
ERROR - Hello error message!
DEBUG - Hello debug message!
INFO - Sending a command ...
failed! // Exception Thrown
... stack trace here ...
or:
INFO - Sending a command ... done. // No Errors