Package frysk.rsl

This package provides a basic logger mechanism.

See:
          Description

Class Summary
Callers Class for constructing a backtrace string.
Level  
Log Generate log information when enabled.
LogFactory Create the specified logger.
LogOption  
Node Generate log information when enabled.
Printer Class for accumulating and then displaying log messages.
 

Package frysk.rsl Description

This package provides a basic logger mechanism.

Overview

The frysk.rsl package provides the client with a baskc framework. The framework is designed to make logging of a programmers code easy and fast; it is not designed for flexibility.

Reporting Interface

The log methods have two general forms, the first for calling from static methods and the second for calling from dynamic methods. The static method looks like:
Log.log(String message, ...)
and the dynamic method:
Log.log(Object self, String message, ...)
the logger calls then take alternating message strings and objects; for instance a typical use looks like:
logger.log("myMethod an-arg", arg); // static
logger.log(this, "myMethod an-arg", arg); // dynamic

Output Format

The log message is displayed blank seperated with specific types formatted as follows:
TypeFormat
charThe character in single quotes
intSigned Decimal
longUnsigned Hexadecimal
Object
ThrowableThe throwable's and all causes's getMessage() wraped in << >>
StringThe escaped string (control chars are converted escaped form))
OtherThe Object's toString() wraped in << >>
[]The array elements formatted according to above
for instance:
logger.log("int", 1, "long", (long)1, "string", "foo\t");
... int 1 long 0x1 string "foo\t"
(notice how casting can be used to select between decimal (int) and hex (long) specific formats.

Command Line Option Syntax

The option parser expects the following syntax:
OPTIONS ::= OPTION { "," OPTION }
OPTION ::= LEVEL | PATH | LEVEL "=" PATH
LEVEL ::= "FINE" | "FINEST" | ...
PATH ::= ... path to package or class ...
For instance:
WhatEffect
FINESTSet all loggers to FINEST
frysk=FINESTSet all frysk loggers to FINEST
fryskSet all frysk loggers to the default logging level (FINE)
frysk.expunit.Expect=FINESTSet the class, and all its sub-classes, to logging level FINEST
frysk=FINE,inua=FINESTSet both the frysk and inua packages logging levels
java.lang.Object=FINESet anything that extends Object's (yes everything) to logging level FINE

Completer

A completer is available for command-lines wanting to provide tab-completion of the known set of loggers.

Implementing a Custom Log

Sometimes the data that needs to be printed is just too wierd a sequence to justify the addition of an additional log method. For those cases, a custom log sequence can be implemented vis:
Log fine = ...;
...
if (fine.logging())
  fine.prefix(this).print("why arg").print(arg).suffix();

Comparison with Existing Loggers

The following differences between this logger and log4j and java.util.Logging are worth noting: