tour

Simple Log: The Simple Way To Log

I need to check this (simple-log) out. Simple log is 3 classes in a 18.2k .jar that might make happy:

The following example is stolen from the simple log website:

public class
HelloWorld
{
// Create a SimpleLogger:
private static final SimpleLogger log = new SimpleLogger(HelloWorld.class);

public static void
main(String[] argv)
{
try
{
// Use it!
log.entry(“main()”);
log.debug(“About to print ‘Hello World!'”);
String helloWorldString = “‘Hello World!'”;
log.dbo(DebugLevel.L6_VERBOSE, “helloWorldString”, helloWorldString);
log.db(DebugLevel.L7_LUDICROUS,
“I can’t believe this library has a level called ‘Ludicrous’!”);

System.out.println(helloWorldString);

log.debug(“Printed ‘Hello World!'”);
log.info(“Did you get that?”);
log.warn(“This example is very contrived.”);
}
catch (Throwable t)
{
// Just in case…
log.fatal(“Something really unexpected dropped by.”);
log.dbe(DebugLevel.L1_FATAL, t);
}
log.exit(“main()”);
}

What I like is the log.entry log.exit thing to log method entries and exits. A sample output look like

Fri 2004/11/26 21:10:32.618|>>>|main|HelloWorld|main()
Fri 2004/11/26 21:10:32.618| |main|HelloWorld|About to print ‘Hello World!’
Fri 2004/11/26 21:10:32.618|—|main|HelloWorld|helloWorldString|’Hello World!’
Fri 2004/11/26 21:10:32.618| |main|HelloWorld|I can’t believe this library has a level called ‘Ludicrous’!
‘Hello World!’
Fri 2004/11/26 21:10:32.618| |main|HelloWorld|Printed ‘Hello World!’
Fri 2004/11/26 21:10:32.618| |main|HelloWorld|Did you get that?
Fri 2004/11/26 21:10:32.618| |main|HelloWorld|This example is very contrived.
Fri 2004/11/26 21:10:32.618|< <<|main|HelloWorld|main()

participate

{ Comments are closed! }

forum

Bear
partner