org.lyra
Class Ledger

java.lang.Object
  extended by org.lyra.Ledger

public class Ledger
extends java.lang.Object

This class will hide certain complexities associated with the built in java.util.Logger class. This will allow us to override the functionality defaults and at the same time allow us to hide the complexities associated with the language properties being attached to this class.

Version:
1.0.5, %Revision, 174%, %LastChangedDate, 27/10/12 3:33PM%
Author:
Martin Foster

Nested Class Summary
private static class Ledger.Levels
           
 
Field Summary
private static java.util.Set<Ledger.Levels> CONFIG
          Configure Level Entities
private static java.lang.String CR
           
private static boolean DEBUG
           
private static java.util.logging.Level DEFAULT
           
private static java.util.Set<Ledger.Levels> FINE
          Fine Level Entities
private static java.util.Set<Ledger.Levels> FINEST
          Finest Level Entities
private static java.util.Set<Ledger.Levels> INFO
          Info Level Entities
private static java.util.logging.Logger logger
           
private  Ledger.Levels myCurrent
           
private static java.util.Set<Ledger.Levels> SEVERE
          Severe Level Entities
private static java.util.Set<Ledger.Levels> WARNING
          Warning Level Entities
 
Constructor Summary
Ledger()
          Standard constructor for this class.
 
Method Summary
 void Adjust(java.util.Map<java.lang.String,java.lang.String> prefs)
          The logger system is used regardless of state of configuration.
 void Config(java.lang.String msg)
          Outputs a given string to the logger property making use of the CONFIG logging level.
 void debugHash(java.util.Map<java.lang.String,java.lang.String> source)
          This method will display the contents of a HashMap as a singular entry in order cut down on entry lines for the log files and make it easier to group the contents together.
 void Fine(java.lang.String cname, java.lang.String cmethod, java.lang.String t)
          Outputs a given string to the logger property making use of the FINE logging level.
 void Finest(java.lang.String cname, java.lang.String cmethod, java.lang.String t)
          Outputs a given string to the logger property making use of the Finest logging level.
 void Info(java.lang.String cname, java.lang.String cmethod, java.lang.String t)
          Outputs a given string to the logger property making use of the INFO logging level.
 boolean isLoggable(java.lang.String lvl)
          Provides the isLoggable capability through the wrapper itself.
 void Severe(java.lang.String cname, java.lang.String cmethod, java.lang.Throwable t)
          Outputs a given string to the logger property making use of the SEVERE logging level.
 void Warn(java.lang.String cname, java.lang.String cmethod, java.lang.String err)
          Outputs a given string to the logger property making use of the WARN logging level.
 void Warn(java.lang.String cname, java.lang.String cmethod, java.lang.Throwable t)
          Outputs a given string to the logger property making use of the WARN logging level.
private  void Write(java.util.logging.Level lvl, java.lang.String msg)
          Actually performs the action of writing to the log file by calling logger proper.
private  void Write(java.util.logging.Level lvl, java.lang.String cname, java.lang.String cmethod, java.lang.String t)
          Actually performs the action of writing to the log file by calling logger proper.
private  void Write(java.util.logging.Level lvl, java.lang.String cname, java.lang.String cmethod, java.lang.Throwable t)
          Actually performs the action of writing to the log file by calling logger proper.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

myCurrent

private Ledger.Levels myCurrent

DEBUG

private static final boolean DEBUG
See Also:
Constant Field Values

DEFAULT

private static final java.util.logging.Level DEFAULT

logger

private static java.util.logging.Logger logger

CR

private static final java.lang.String CR

SEVERE

private static final java.util.Set<Ledger.Levels> SEVERE
Severe Level Entities


WARNING

private static final java.util.Set<Ledger.Levels> WARNING
Warning Level Entities


INFO

private static final java.util.Set<Ledger.Levels> INFO
Info Level Entities


CONFIG

private static final java.util.Set<Ledger.Levels> CONFIG
Configure Level Entities


FINE

private static final java.util.Set<Ledger.Levels> FINE
Fine Level Entities


FINEST

private static final java.util.Set<Ledger.Levels> FINEST
Finest Level Entities

Constructor Detail

Ledger

public Ledger()
Standard constructor for this class. It will create a stored logger which will be called when appropriate.

NOTE: This constructor will be configured regardless of improper handling by the configuration file. Instead of a custom logger defaults are employed.

Method Detail

Adjust

public void Adjust(java.util.Map<java.lang.String,java.lang.String> prefs)
The logger system is used regardless of state of configuration. It is necessary to configure it appropriately once the information has been retrieved. If this is not the case, the Ledger class provides a constant interface no matter the situation.

Parameters:
prefs - Contains the preferences for the application.

debugHash

public void debugHash(java.util.Map<java.lang.String,java.lang.String> source)
This method will display the contents of a HashMap as a singular entry in order cut down on entry lines for the log files and make it easier to group the contents together.

Parameters:
source - Map containing elements that have to be displayed.

isLoggable

public boolean isLoggable(java.lang.String lvl)
Provides the isLoggable capability through the wrapper itself. Without this method it would mean that certain operations would be costly processor time wise.

Parameters:
lvl - String version of the level we are interested in.
Returns:
boolean Simple true or false for insertion into IF statements.

Config

public void Config(java.lang.String msg)
Outputs a given string to the logger property making use of the CONFIG logging level.

Parameters:
msg - String containing the full message.

Fine

public void Fine(java.lang.String cname,
                 java.lang.String cmethod,
                 java.lang.String t)
Outputs a given string to the logger property making use of the FINE logging level.

Parameters:
cname - Class Name
cmethod - Class Method
t - String containing message

Finest

public void Finest(java.lang.String cname,
                   java.lang.String cmethod,
                   java.lang.String t)
Outputs a given string to the logger property making use of the Finest logging level.

Parameters:
cname - Class Name
cmethod - Class Method
t - String containing message

Info

public void Info(java.lang.String cname,
                 java.lang.String cmethod,
                 java.lang.String t)
Outputs a given string to the logger property making use of the INFO logging level.

Parameters:
cname - Class Name
cmethod - Class Method
t - String containing message

Severe

public void Severe(java.lang.String cname,
                   java.lang.String cmethod,
                   java.lang.Throwable t)
Outputs a given string to the logger property making use of the SEVERE logging level.

Parameters:
cname - Class Name
cmethod - Class Method
t - Throwable class which details errors.

Warn

public void Warn(java.lang.String cname,
                 java.lang.String cmethod,
                 java.lang.Throwable t)
Outputs a given string to the logger property making use of the WARN logging level.

Parameters:
cname - Class Name
cmethod - Class Method
t - Throwable class which details errors.

Warn

public void Warn(java.lang.String cname,
                 java.lang.String cmethod,
                 java.lang.String err)
Outputs a given string to the logger property making use of the WARN logging level.

Parameters:
cname - Class Name
cmethod - Class Method
err - String formatted with error.

Write

private void Write(java.util.logging.Level lvl,
                   java.lang.String msg)
Actually performs the action of writing to the log file by calling logger proper.

Parameters:
lvl - Logging level
msg - Category of the message code from the language properties.

Write

private void Write(java.util.logging.Level lvl,
                   java.lang.String cname,
                   java.lang.String cmethod,
                   java.lang.Throwable t)
Actually performs the action of writing to the log file by calling logger proper.

Parameters:
lvl - Logging Level
cname - Class Name
cmethod - Class Method
t - Throwable class

Write

private void Write(java.util.logging.Level lvl,
                   java.lang.String cname,
                   java.lang.String cmethod,
                   java.lang.String t)
Actually performs the action of writing to the log file by calling logger proper.

Parameters:
lvl - Logging Level
cname - Class Name
cmethod - Class Method
t - String containing text