Personal Java library or reusable components.
eadjlib.logger
Customisable logging system with different formatting and output options.
It is recommended to write a toString()
method to all classes.
This is what the logger will output when you pass it instances of those
classes.
void log( Object... objects ); //Standard message
void log_Fatal( Object... objects ); //Fatal event
void log_Error( Object... objects ); //Error
void log_Warning( Object... objects ); //Warning
void log_Debug( Object... objects ); //Debug
void log_Trace( Object... objects ); //For tracing
void log_Exception( Exception e ); //For pushing exception to the log after an error
Logger log = Logger.getLoggerInstance( Myclass.class.getName() );
log.log( "Testing ", 1, ", " , 2, ", ", 3, ", and some more..." );
When catching an exception and logging it is required the "log_Exception" call can be used to add the stacktrace to the log after a previous message detailing the event.
e.g.:
try {
/** some stuff that raises an exception **/
} catch ( Exception e ) {
log.log_error( "An exception was raise because..." ),
log.log_Exception( e )
}
The log_config.cfg
file is created during the first run of the logger
if it isn't there already. Inside you can set your options for the logging
like the log level and outputs you want to see the log messages in.
To create a viewer for the log:
- Add
OUTPUT=<WINDOW,window_name>
to the log's config file, - Create a class that implements
Log_Window_Interface
to pass the messages from the log to your viewer, - Call
connectView( Log_Window_Interface )
with your implemented class as an argument to connect the logger to the class.
An example implementation of a GUI log viewer using JavaFX is available here.
AVLTree<K,V>
Balanced binary tree where the heights of every node differ at most by +/- 1.
ObjectTable
Object table for caching/transporting SQL result sets. Elements are added in sequential order left-to-right, row-by-row from the top.
Cursor
Tuple container that holds row and column indices.
This software is released under the GNU General Public License 2 license.
Please reference when used in project and/or research and/or papers and/or integrated in production code (i.e.: DBAD).
Copyright E. A. Davison 2016-17.