toxTree.logging
Class TTLogger

java.lang.Object
  extended by toxTree.logging.TTLogger

public class TTLogger
extends java.lang.Object

Logging facility

Author:
Nina Jeliazkova Modified 2005-8-19

Field Summary
 int DEFAULT_STACK_LENGTH
          Default number of StackTraceElements to be printed by debug(Exception).
 
Constructor Summary
TTLogger()
           
TTLogger(java.lang.Class classInst)
           
TTLogger(java.lang.Object object)
          Constructs a LoggingTool which produces log lines indicating them to be for the Class of the Object.
 
Method Summary
static void configureLog4j(boolean console)
           
static void configureLog4j(java.lang.String file)
           
 void debug(java.lang.Object object)
          Shows DEBUG output for the Object.
 void debug(java.lang.Object object, boolean bool)
          Shows DEBUG output for the given Object's.
 void debug(java.lang.Object object, double number)
          Shows DEBUG output for the given Object's.
 void debug(java.lang.Object object, int number)
          Shows DEBUG output for the given Object's.
 void debug(java.lang.Object object, java.lang.Object object2)
          Shows DEBUG output for the given Object's.
 void debug(java.lang.Object obj, java.lang.Object obj2, java.lang.Object obj3)
          Shows DEBUG output for the given Object's.
 void debug(java.lang.Object obj, java.lang.Object obj2, java.lang.Object obj3, java.lang.Object obj4)
          Shows DEBUG output for the given Object's.
 void debug(java.lang.Object obj, java.lang.Object obj2, java.lang.Object obj3, java.lang.Object obj4, java.lang.Object obj5)
          Shows DEBUG output for the given Object's.
 void dumpClasspath()
          Outputs the system property for java.class.path.
 void dumpSystemProperties()
          Outputs system properties for the operating system and the java version.
 void error(java.lang.Object object)
          Shows ERROR output for the Object.
 void error(java.lang.Object object, boolean bool)
          Shows ERROR output for the given Object's.
 void error(java.lang.Object object, double number)
          Shows ERROR output for the given Object's.
 void error(java.lang.Object object, int number)
          Shows ERROR output for the given Object's.
 void error(java.lang.Object object, java.lang.Object object2)
          Shows ERROR output for the given Object's.
 void error(java.lang.Object obj, java.lang.Object obj2, java.lang.Object obj3)
          Shows ERROR output for the given Object's.
 void error(java.lang.Object obj, java.lang.Object obj2, java.lang.Object obj3, java.lang.Object obj4)
          Shows ERROR output for the given Object's.
 void error(java.lang.Object obj, java.lang.Object obj2, java.lang.Object obj3, java.lang.Object obj4, java.lang.Object obj5)
          Shows ERROR output for the given Object's.
 void fatal(java.lang.Object object)
          Shows FATAL output for the Object.
 void info(java.lang.Object object)
          Shows INFO output for the Object.
 void info(java.lang.Object object, boolean bool)
          Shows INFO output for the given Object's.
 void info(java.lang.Object object, double number)
          Shows INFO output for the given Object's.
 void info(java.lang.Object object, int number)
          Shows INFO output for the given Object's.
 void info(java.lang.Object object, java.lang.Object object2)
          Shows INFO output for the given Object's.
 void info(java.lang.Object obj, java.lang.Object obj2, java.lang.Object obj3)
          Shows INFO output for the given Object's.
 void info(java.lang.Object obj, java.lang.Object obj2, java.lang.Object obj3, java.lang.Object obj4)
          Shows INFO output for the given Object's.
 void info(java.lang.Object obj, java.lang.Object obj2, java.lang.Object obj3, java.lang.Object obj4, java.lang.Object obj5)
          Shows INFO output for the given Object's.
 boolean isDebugEnabled()
          Use this method for computational demanding debug info.
 void setStackLength(int length)
          Sets the number of StackTraceElements to be printed in DEBUG mode when calling debug(Throwable).
 void warn(java.lang.Object object)
          Shows WARN output for the Object.
 void warn(java.lang.Object object, boolean bool)
          Shows WARN output for the given Object's.
 void warn(java.lang.Object object, double number)
          Shows WARN output for the given Object's.
 void warn(java.lang.Object object, int number)
          Shows WARN output for the given Object's.
 void warn(java.lang.Object object, java.lang.Object object2)
          Shows WARN output for the given Object's.
 void warn(java.lang.Object obj, java.lang.Object obj2, java.lang.Object obj3)
          Shows WARN output for the given Object's.
 void warn(java.lang.Object obj, java.lang.Object obj2, java.lang.Object obj3, java.lang.Object obj4)
          Shows WARN output for the given Object's.
 void warn(java.lang.Object obj, java.lang.Object obj2, java.lang.Object obj3, java.lang.Object obj4, java.lang.Object obj5)
          Shows WARN output for the given Object's.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_STACK_LENGTH

public final int DEFAULT_STACK_LENGTH
Default number of StackTraceElements to be printed by debug(Exception).

See Also:
Constant Field Values
Constructor Detail

TTLogger

public TTLogger()

TTLogger

public TTLogger(java.lang.Object object)
Constructs a LoggingTool which produces log lines indicating them to be for the Class of the Object.

Parameters:
object - Object from which the log messages originate

TTLogger

public TTLogger(java.lang.Class classInst)
Method Detail

configureLog4j

public static void configureLog4j(boolean console)

configureLog4j

public static void configureLog4j(java.lang.String file)

dumpSystemProperties

public void dumpSystemProperties()
Outputs system properties for the operating system and the java version. More specifically: os.name, os.version, os.arch, java.version and java.vendor.


setStackLength

public void setStackLength(int length)
Sets the number of StackTraceElements to be printed in DEBUG mode when calling debug(Throwable). The default value is DEFAULT_STACK_LENGTH.

Parameters:
length - the new stack length
See Also:
DEFAULT_STACK_LENGTH

dumpClasspath

public void dumpClasspath()
Outputs the system property for java.class.path.


debug

public void debug(java.lang.Object object)
Shows DEBUG output for the Object. If the object is an instanceof Throwable it will output the trace. Otherwise it will use the toString() method.

Parameters:
object - Object to apply toString() too and output

debug

public void debug(java.lang.Object object,
                  java.lang.Object object2)
Shows DEBUG output for the given Object's. It uses the toString() method to concatenate the objects.

Parameters:
object - Object to apply toString() too and output
object2 - Object to apply toString() too and output

debug

public void debug(java.lang.Object object,
                  int number)
Shows DEBUG output for the given Object's. It uses the toString() method to concatenate the objects.

Parameters:
object - Object to apply toString() too and output
number - int to concatenate to object

debug

public void debug(java.lang.Object object,
                  double number)
Shows DEBUG output for the given Object's. It uses the toString() method to concatenate the objects.

Parameters:
object - Object to apply toString() too and output
number - int to concatenate to object

debug

public void debug(java.lang.Object object,
                  boolean bool)
Shows DEBUG output for the given Object's. It uses the toString() method to concatenate the objects.

Parameters:
object - Object to apply toString() too and output
bool - boolean to concatenate to object

debug

public void debug(java.lang.Object obj,
                  java.lang.Object obj2,
                  java.lang.Object obj3)
Shows DEBUG output for the given Object's. It uses the toString() method to concatenate the objects.

Parameters:
obj - Object to apply toString() too and output
obj2 - Object to apply toString() too and output
obj3 - Object to apply toString() too and output

debug

public void debug(java.lang.Object obj,
                  java.lang.Object obj2,
                  java.lang.Object obj3,
                  java.lang.Object obj4)
Shows DEBUG output for the given Object's. It uses the toString() method to concatenate the objects.

Parameters:
obj - Object to apply toString() too and output
obj2 - Object to apply toString() too and output
obj3 - Object to apply toString() too and output
obj4 - Object to apply toString() too and output

debug

public void debug(java.lang.Object obj,
                  java.lang.Object obj2,
                  java.lang.Object obj3,
                  java.lang.Object obj4,
                  java.lang.Object obj5)
Shows DEBUG output for the given Object's. It uses the toString() method to concatenate the objects.

Parameters:
obj - Object to apply toString() too and output
obj2 - Object to apply toString() too and output
obj3 - Object to apply toString() too and output
obj4 - Object to apply toString() too and output
obj5 - Object to apply toString() too and output

error

public void error(java.lang.Object object)
Shows ERROR output for the Object. It uses the toString() method.

Parameters:
object - Object to apply toString() too and output

error

public void error(java.lang.Object object,
                  int number)
Shows ERROR output for the given Object's. It uses the toString() method to concatenate the objects.

Parameters:
object - Object to apply toString() too and output
number - int to concatenate to object

error

public void error(java.lang.Object object,
                  double number)
Shows ERROR output for the given Object's. It uses the toString() method to concatenate the objects.

Parameters:
object - Object to apply toString() too and output
number - double to concatenate to object

error

public void error(java.lang.Object object,
                  boolean bool)
Shows ERROR output for the given Object's. It uses the toString() method to concatenate the objects.

Parameters:
object - Object to apply toString() too and output
bool - boolean to concatenate to object

error

public void error(java.lang.Object object,
                  java.lang.Object object2)
Shows ERROR output for the given Object's. It uses the toString() method to concatenate the objects.

Parameters:
object - Object to apply toString() too and output
object2 - Object to apply toString() too and output

error

public void error(java.lang.Object obj,
                  java.lang.Object obj2,
                  java.lang.Object obj3)
Shows ERROR output for the given Object's. It uses the toString() method to concatenate the objects.

Parameters:
obj - Object to apply toString() too and output
obj2 - Object to apply toString() too and output
obj3 - Object to apply toString() too and output

error

public void error(java.lang.Object obj,
                  java.lang.Object obj2,
                  java.lang.Object obj3,
                  java.lang.Object obj4)
Shows ERROR output for the given Object's. It uses the toString() method to concatenate the objects.

Parameters:
obj - Object to apply toString() too and output
obj2 - Object to apply toString() too and output
obj3 - Object to apply toString() too and output
obj4 - Object to apply toString() too and output

error

public void error(java.lang.Object obj,
                  java.lang.Object obj2,
                  java.lang.Object obj3,
                  java.lang.Object obj4,
                  java.lang.Object obj5)
Shows ERROR output for the given Object's. It uses the toString() method to concatenate the objects.

Parameters:
obj - Object to apply toString() too and output
obj2 - Object to apply toString() too and output
obj3 - Object to apply toString() too and output
obj4 - Object to apply toString() too and output
obj5 - Object to apply toString() too and output

fatal

public void fatal(java.lang.Object object)
Shows FATAL output for the Object. It uses the toString() method.

Parameters:
object - Object to apply toString() too and output

info

public void info(java.lang.Object object)
Shows INFO output for the Object. It uses the toString() method.

Parameters:
object - Object to apply toString() too and output

info

public void info(java.lang.Object object,
                 int number)
Shows INFO output for the given Object's. It uses the toString() method to concatenate the objects.

Parameters:
object - Object to apply toString() too and output
number - int to concatenate to object

info

public void info(java.lang.Object object,
                 double number)
Shows INFO output for the given Object's. It uses the toString() method to concatenate the objects.

Parameters:
object - Object to apply toString() too and output
number - double to concatenate to object

info

public void info(java.lang.Object object,
                 boolean bool)
Shows INFO output for the given Object's. It uses the toString() method to concatenate the objects.

Parameters:
object - Object to apply toString() too and output
bool - boolean to concatenate to object

info

public void info(java.lang.Object object,
                 java.lang.Object object2)
Shows INFO output for the given Object's. It uses the toString() method to concatenate the objects.

Parameters:
object - Object to apply toString() too and output
object2 - Object to apply toString() too and output

info

public void info(java.lang.Object obj,
                 java.lang.Object obj2,
                 java.lang.Object obj3)
Shows INFO output for the given Object's. It uses the toString() method to concatenate the objects.

Parameters:
obj - Object to apply toString() too and output
obj2 - Object to apply toString() too and output
obj3 - Object to apply toString() too and output

info

public void info(java.lang.Object obj,
                 java.lang.Object obj2,
                 java.lang.Object obj3,
                 java.lang.Object obj4)
Shows INFO output for the given Object's. It uses the toString() method to concatenate the objects.

Parameters:
obj - Object to apply toString() too and output
obj2 - Object to apply toString() too and output
obj3 - Object to apply toString() too and output
obj4 - Object to apply toString() too and output

info

public void info(java.lang.Object obj,
                 java.lang.Object obj2,
                 java.lang.Object obj3,
                 java.lang.Object obj4,
                 java.lang.Object obj5)
Shows INFO output for the given Object's. It uses the toString() method to concatenate the objects.

Parameters:
obj - Object to apply toString() too and output
obj2 - Object to apply toString() too and output
obj3 - Object to apply toString() too and output
obj4 - Object to apply toString() too and output
obj5 - Object to apply toString() too and output

warn

public void warn(java.lang.Object object)
Shows WARN output for the Object. It uses the toString() method.

Parameters:
object - Object to apply toString() too and output

warn

public void warn(java.lang.Object object,
                 int number)
Shows WARN output for the given Object's. It uses the toString() method to concatenate the objects.

Parameters:
object - Object to apply toString() too and output
number - int to concatenate to object

warn

public void warn(java.lang.Object object,
                 boolean bool)
Shows WARN output for the given Object's. It uses the toString() method to concatenate the objects.

Parameters:
object - Object to apply toString() too and output
bool - boolean to concatenate to object

warn

public void warn(java.lang.Object object,
                 double number)
Shows WARN output for the given Object's. It uses the toString() method to concatenate the objects.

Parameters:
object - Object to apply toString() too and output
number - double to concatenate to object

warn

public void warn(java.lang.Object object,
                 java.lang.Object object2)
Shows WARN output for the given Object's. It uses the toString() method to concatenate the objects.

Parameters:
object - Object to apply toString() too and output
object2 - Object to apply toString() too and output

warn

public void warn(java.lang.Object obj,
                 java.lang.Object obj2,
                 java.lang.Object obj3)
Shows WARN output for the given Object's. It uses the toString() method to concatenate the objects.

Parameters:
obj - Object to apply toString() too and output
obj2 - Object to apply toString() too and output
obj3 - Object to apply toString() too and output

warn

public void warn(java.lang.Object obj,
                 java.lang.Object obj2,
                 java.lang.Object obj3,
                 java.lang.Object obj4)
Shows WARN output for the given Object's. It uses the toString() method to concatenate the objects.

Parameters:
obj - Object to apply toString() too and output
obj2 - Object to apply toString() too and output
obj3 - Object to apply toString() too and output
obj4 - Object to apply toString() too and output

warn

public void warn(java.lang.Object obj,
                 java.lang.Object obj2,
                 java.lang.Object obj3,
                 java.lang.Object obj4,
                 java.lang.Object obj5)
Shows WARN output for the given Object's. It uses the toString() method to concatenate the objects.

Parameters:
obj - Object to apply toString() too and output
obj2 - Object to apply toString() too and output
obj3 - Object to apply toString() too and output
obj4 - Object to apply toString() too and output
obj5 - Object to apply toString() too and output

isDebugEnabled

public boolean isDebugEnabled()
Use this method for computational demanding debug info. For example:
 if (logger.isDebugEnabled()) {
   logger.info("The 1056389822th prime that is used is: ",
                calculatePrime(1056389822));
 }
 

Returns:
true, if debug is enabled


Copyright © 2004-2012 Ideaconsult Ltd.. All Rights Reserved.