ProgramixGenericLib v5.0.1

com.programix.thread
Class LineLogger

java.lang.Object
  extended by com.programix.thread.LineLogger
All Implemented Interfaces:
ThreadSafe

public class LineLogger
extends Object
implements ThreadSafe

Logs messages a line at a time prefixing each line with the elapsed time since the first message was sent and the name of the thread that sent the message.

Author:
Paul Hyde

Nested Class Summary
static class LineLogger.ConsoleOutput
          An implementation of LineLogger.Output that just sends the output to the console (System.out).
static interface LineLogger.Output
          Used as a destination for lines sent to LineLogger.
static class LineLogger.TextAreaOutput
          An implementation of LineLogger.Output that appends output to a JTextArea.
 
Constructor Summary
LineLogger()
          Defaults to use the LineLogger.ConsoleOutput instance.
LineLogger(LineLogger.Output output)
           
 
Method Summary
 int getThreadNameLength()
           
 int getTimeFormatLength()
           
 boolean isPrefixWithThreadName()
           
 boolean isPrefixWithTime()
           
 void out(Object msg)
           
 void out(String msg)
           
 void outln(Object msg)
           
 void outln(String msg)
           
 void printStackTrace(Throwable t)
           
 void setOutput(LineLogger.Output output)
           
 void setPrefixWithThreadName(boolean prefixWithThreadName)
           
 void setPrefixWithTime(boolean prefixWithTime)
           
 void setThreadNameLength(int threadNameLength)
           
 void setTimeFormatLength(int timeFormatLength)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LineLogger

public LineLogger(LineLogger.Output output)

LineLogger

public LineLogger()
Defaults to use the LineLogger.ConsoleOutput instance.

Method Detail

setOutput

public void setOutput(LineLogger.Output output)

isPrefixWithThreadName

public boolean isPrefixWithThreadName()

setPrefixWithThreadName

public void setPrefixWithThreadName(boolean prefixWithThreadName)

getThreadNameLength

public int getThreadNameLength()

setThreadNameLength

public void setThreadNameLength(int threadNameLength)

isPrefixWithTime

public boolean isPrefixWithTime()

setPrefixWithTime

public void setPrefixWithTime(boolean prefixWithTime)

getTimeFormatLength

public int getTimeFormatLength()

setTimeFormatLength

public void setTimeFormatLength(int timeFormatLength)
                         throws IllegalArgumentException
Throws:
IllegalArgumentException

out

public void out(String msg)

outln

public void outln(String msg)

out

public void out(Object msg)

outln

public void outln(Object msg)

printStackTrace

public void printStackTrace(Throwable t)

ProgramixGenericLib v5.0.1

Copyright © 2001-2009 Programix Incorporated. All rights reserved. ProgramixGenericLib is free and is OSI Certified Open Source Software under the BSD license.