Log - The easiest-to-use logging system
Log is a very easy-to-use logging system, replacing efficiently
"System.out.println()" debugging. Compared to the standard Logging class,
or compared to the well known Log4J package, this one aims to follow Pareto's
law: You will get 80% of the functionalities, but you will spend only 20% of
your time. And most users even need less than 80%...
Main features
- Finds out automatically the class name, the method name, the source
file and the line number for every logging operation. For example the line
Log.enter()
will log the following line: *enter: LogTest.execute(LogTest.java:34)
,
indicating that the program entered in the
execute() method, in the LogTest class, and the log instruction is written
in the LogTest.java file at line 34.
- Every logging operation can be associated to a specific level. For
example
Log.log("Important debugging information", Log.DEBUG)
will be logged only if the current level is equal or less than the
specified one (Log.DEBUG). The current level can be defined generically or
specified for each class.
- The loggings can be displayed in the console or recorded in files, using
different levels. We could imagine that, during a program development, we
first display a lot of debugging information in the console; then, we set
the current console level to Log.SEVERE
(
setConsoleLevel(Log.SEVERE)
) in order to display only fatal
errors, but we still record all the loggings in files in case of a program
crash.
More information
See the javadoc to get more information, a full example, and see how easy it is to use!
LogViewer
LogViewer is a little application that let you analyse log files and make very efficient searches using the power of regular expressions.
Downloads
Download the Log class (version 0.1), the javadoc and the examples (25.5 Ko)
Download the LogViewer application (52.9 Ko)