org.incava.qualog

Class QlWriter

public class QlWriter extends Object

Writes the logging output, applying filters and decorations. The Qualog class offers a much cleaner and more thorough interface than this class.

See Also: Qualog

Field Summary
ListclassesSkipped
intclassWidth
booleancolumns
intfileWidth
intfunctionWidth
intlineWidth
ListmethodsSkipped
static intNO_OUTPUT
PrintWriterout
ListpackagesSkipped
static intQUIET
booleanshowClasses
booleanshowFiles
static intVERBOSE
Method Summary
voidaddClassSkipped(Class cls)
voidaddClassSkipped(String clsName)
voidaddFilter(QlFilter filter)
Adds a filter to be applied for output.
protected voidappendPadded(StringBuffer buf, String str, int maxSize)
voidclear()
Resets parameters to their defaults.
voidclearClassColor(String className)
intfindStackStart(StackTraceElement[] stack)
Returns the index in the stack where logging (stacks) should be displayed.
protected StackTraceElement[]getStack(int depth)
booleanisLoggable(QlLevel level)
booleanisSkipped(StackTraceElement ste)
protected StringobjectToString(Object obj)
protected voidoutputClassAndMethod(StringBuffer buf, ANSIColor classColor, ANSIColor methodColor, StackTraceElement stackElement)
protected voidoutputFileName(StringBuffer buf, ANSIColor fileColor, StackTraceElement stackElement)
protected voidoutputMessage(StringBuffer buf, int framesShown, ANSIColor[] msgColor, String msg, StackTraceElement stackElement)
protected Stringrepeat(int len, char ch)
protected StringBufferrepeat(StringBuffer buf, int len, char ch)
voidreset()
voidset(boolean columns, int fileWidth, int lineWidth, int classWidth, int functionWidth)
voidsetClassColor(String className, ANSIColor color)
voidsetColumns(boolean cols)
voidsetDisabled(Class cls)
voidsetFileColor(String fileName, ANSIColor color)
voidsetMethodColor(String className, String methodName, ANSIColor color)
voidsetOutput(int type, QlLevel level)
Sets the output type and level.
voidsetPackageColor(String pkg, ANSIColor color)
booleanstack(QlLevel level, ANSIColor[] msgColors, String name, Object obj, ANSIColor fileColor, ANSIColor classColor, ANSIColor methodColor, int numFrames)
booleanstack(QlLevel lvl, ANSIColor[] msgColor, String msg, ANSIColor fileColor, ANSIColor classColor, ANSIColor methodColor, int numFrames)
booleanverbose()

Field Detail

classesSkipped

public List classesSkipped

classWidth

public int classWidth

columns

public boolean columns

fileWidth

public int fileWidth

functionWidth

public int functionWidth

lineWidth

public int lineWidth

methodsSkipped

public List methodsSkipped

NO_OUTPUT

public static final int NO_OUTPUT

out

public PrintWriter out

packagesSkipped

public List packagesSkipped

QUIET

public static final int QUIET

showClasses

public boolean showClasses

showFiles

public boolean showFiles

VERBOSE

public static final int VERBOSE

Method Detail

addClassSkipped

public void addClassSkipped(Class cls)

addClassSkipped

public void addClassSkipped(String clsName)

addFilter

public void addFilter(QlFilter filter)
Adds a filter to be applied for output.

See Also: QlFilter

appendPadded

protected void appendPadded(StringBuffer buf, String str, int maxSize)

clear

public void clear()
Resets parameters to their defaults.

clearClassColor

public void clearClassColor(String className)

findStackStart

public int findStackStart(StackTraceElement[] stack)
Returns the index in the stack where logging (stacks) should be displayed. Returns -1 if the end of the stack is reached and no logging should occur.

getStack

protected StackTraceElement[] getStack(int depth)

isLoggable

public boolean isLoggable(QlLevel level)

isSkipped

public boolean isSkipped(StackTraceElement ste)

objectToString

protected String objectToString(Object obj)

outputClassAndMethod

protected void outputClassAndMethod(StringBuffer buf, ANSIColor classColor, ANSIColor methodColor, StackTraceElement stackElement)

outputFileName

protected void outputFileName(StringBuffer buf, ANSIColor fileColor, StackTraceElement stackElement)

outputMessage

protected void outputMessage(StringBuffer buf, int framesShown, ANSIColor[] msgColor, String msg, StackTraceElement stackElement)

repeat

protected String repeat(int len, char ch)

repeat

protected StringBuffer repeat(StringBuffer buf, int len, char ch)

reset

public void reset()

set

public void set(boolean columns, int fileWidth, int lineWidth, int classWidth, int functionWidth)

setClassColor

public void setClassColor(String className, ANSIColor color)

setColumns

public void setColumns(boolean cols)

setDisabled

public void setDisabled(Class cls)

setFileColor

public void setFileColor(String fileName, ANSIColor color)

setMethodColor

public void setMethodColor(String className, String methodName, ANSIColor color)

setOutput

public void setOutput(int type, QlLevel level)
Sets the output type and level. Either verbose or quiet can be enabled.

setPackageColor

public void setPackageColor(String pkg, ANSIColor color)

stack

public boolean stack(QlLevel level, ANSIColor[] msgColors, String name, Object obj, ANSIColor fileColor, ANSIColor classColor, ANSIColor methodColor, int numFrames)

stack

public boolean stack(QlLevel lvl, ANSIColor[] msgColor, String msg, ANSIColor fileColor, ANSIColor classColor, ANSIColor methodColor, int numFrames)

verbose

public boolean verbose()