public class ConsoleLoggerSingleton extends Object implements ConsoleLogger
ConsoleLoggerSingleton
provides a ConsoleLoggerImpl
singleton .org.refcodes.mixin.RowWidthAccessor.RowWidthBuilder<B extends org.refcodes.mixin.RowWidthAccessor.RowWidthBuilder<?>>, org.refcodes.mixin.RowWidthAccessor.RowWidthMutator, org.refcodes.mixin.RowWidthAccessor.RowWidthProperty
org.refcodes.textual.TableStyleAccessor.TableStyleBuilder<B extends org.refcodes.textual.TableStyleAccessor.TableStyleBuilder<?>>, org.refcodes.textual.TableStyleAccessor.TableStyleMutator, org.refcodes.textual.TableStyleAccessor.TableStyleProperty
Constructor and Description |
---|
ConsoleLoggerSingleton()
Constructor for constructing a pseudo singleton; this constructor is
public to provide means to some configuration frameworks (such as
commons-configurations from Apache) for using this
ConsoleLoggerSingleton even when not being able to access the
getInstance() method. |
Modifier and Type | Method and Description |
---|---|
PrintStream |
getErrStream() |
static ConsoleLogger<?> |
getInstance()
Returns the singleton's instance as fabricated by this
ConsoleLoggerSingleton . |
PrintStream |
getOutStream() |
int |
getRowWidth() |
org.refcodes.textual.TableStyle |
getTableStyle() |
boolean |
hasLeftBorder() |
boolean |
hasRightBorder() |
void |
log(org.refcodes.tabular.Record aRecord) |
void |
setErrStream(PrintStream aErrStream) |
void |
setEscCodes(boolean isEscCodesEnabled) |
void |
setLeftBorder(boolean hasLeftBorder) |
void |
setOutStream(PrintStream aOutStream) |
void |
setRightBorder(boolean hasRightBorder) |
void |
setRowWidth(int aRowWidth) |
void |
setTableStyle(org.refcodes.textual.TableStyle aTableStyle) |
void |
setTableStyleName(String aTableStyleName)
As the underlying configuration framework used by the
RuntimeLoggerSingleton cannot convert a String to an enum, we got
to provide such a method ourselves. |
ConsoleLoggerSingleton |
withErrStream(PrintStream aErrStream) |
ConsoleLoggerSingleton |
withEscCodes(boolean isEscCodesEnabled) |
ConsoleLoggerSingleton |
withLeftBorder(boolean hasLeftBorder) |
ConsoleLoggerSingleton |
withOutStream(PrintStream aOutStream) |
ConsoleLoggerSingleton |
withRightBorder(boolean hasRightBorder) |
org.refcodes.mixin.RowWidthAccessor.RowWidthBuilder |
withRowWidth(int aRowWidth) |
ConsoleLoggerSingleton |
withTableStyle(org.refcodes.textual.TableStyle aTableStyle) |
public ConsoleLoggerSingleton()
ConsoleLoggerSingleton
even when not being able to access the
getInstance()
method. The instance overhead for providing
singleton behavior is taken into account.public static ConsoleLogger<?> getInstance() throws org.refcodes.logger.LoggerInstantiationRuntimeException
ConsoleLoggerSingleton
.RuntimeLogger
singleton's instance.org.refcodes.logger.LoggerInstantiationRuntimeException
- Thrown in case instantiating
a Logger
(RuntimeLogger
) failedpublic void log(org.refcodes.tabular.Record aRecord) throws org.refcodes.logger.IllegalRecordRuntimeException, org.refcodes.logger.UnexpectedLogRuntimeException
log
in interface org.refcodes.logger.Logger
org.refcodes.logger.IllegalRecordRuntimeException
org.refcodes.logger.UnexpectedLogRuntimeException
public PrintStream getOutStream()
getOutStream
in interface ConsoleLogger
public void setOutStream(PrintStream aOutStream)
setOutStream
in interface ConsoleLogger
public PrintStream getErrStream()
getErrStream
in interface ConsoleLogger
public void setErrStream(PrintStream aErrStream)
setErrStream
in interface ConsoleLogger
public org.refcodes.textual.TableStyle getTableStyle()
getTableStyle
in interface org.refcodes.textual.TableStyleAccessor
public void setTableStyle(org.refcodes.textual.TableStyle aTableStyle)
setTableStyle
in interface org.refcodes.textual.TableStyleAccessor.TableStyleMutator
public void setTableStyleName(String aTableStyleName)
ConsoleLogger
RuntimeLoggerSingleton
cannot convert a String to an enum, we got
to provide such a method ourselves. When configuring programmatically use
RowWidthAccessor.RowWidthMutator.setRowWidth(int)
or RowWidthAccessor.RowWidthBuilder.withRowWidth(int)
, when using the
"runtimelogger-config.xml" ise the property "tableStyleName" for this
method to be invoked. Valid arguments are as of the TableStyle
enumeration:
setTableStyleName
in interface ConsoleLogger
public void setEscCodes(boolean isEscCodesEnabled)
setEscCodes
in interface ConsoleLogger
public boolean hasLeftBorder()
hasLeftBorder
in interface ConsoleLogger
public void setLeftBorder(boolean hasLeftBorder)
setLeftBorder
in interface ConsoleLogger
public boolean hasRightBorder()
hasRightBorder
in interface ConsoleLogger
public void setRightBorder(boolean hasRightBorder)
setRightBorder
in interface ConsoleLogger
public int getRowWidth()
getRowWidth
in interface org.refcodes.mixin.RowWidthAccessor
public void setRowWidth(int aRowWidth)
setRowWidth
in interface org.refcodes.mixin.RowWidthAccessor.RowWidthMutator
public ConsoleLoggerSingleton withOutStream(PrintStream aOutStream)
withOutStream
in interface ConsoleLogger
public ConsoleLoggerSingleton withErrStream(PrintStream aErrStream)
withErrStream
in interface ConsoleLogger
public ConsoleLoggerSingleton withTableStyle(org.refcodes.textual.TableStyle aTableStyle)
withTableStyle
in interface org.refcodes.textual.TableStyleAccessor.TableStyleBuilder
public ConsoleLoggerSingleton withEscCodes(boolean isEscCodesEnabled)
withEscCodes
in interface ConsoleLogger
public ConsoleLoggerSingleton withLeftBorder(boolean hasLeftBorder)
withLeftBorder
in interface ConsoleLogger
public ConsoleLoggerSingleton withRightBorder(boolean hasRightBorder)
withRightBorder
in interface ConsoleLogger
public org.refcodes.mixin.RowWidthAccessor.RowWidthBuilder withRowWidth(int aRowWidth)
withRowWidth
in interface org.refcodes.mixin.RowWidthAccessor.RowWidthBuilder
Copyright © 2017. All rights reserved.