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.RowWidthPropertyorg.refcodes.textual.TableStyleAccessor.TableStyleBuilder<B extends org.refcodes.textual.TableStyleAccessor.TableStyleBuilder<?>>, org.refcodes.textual.TableStyleAccessor.TableStyleMutator, org.refcodes.textual.TableStyleAccessor.TableStylePropertyorg.refcodes.mixin.StandardPrintStreamAccessor.StandardPrintStreamBuilder<B extends org.refcodes.mixin.StandardPrintStreamAccessor.StandardPrintStreamBuilder<?>>, org.refcodes.mixin.StandardPrintStreamAccessor.StandardPrintStreamMutator, org.refcodes.mixin.StandardPrintStreamAccessor.StandardPrintStreamPropertyorg.refcodes.mixin.ErrorPrintStreamAccessor.ErrorPrintStreamBuilder<B extends org.refcodes.mixin.ErrorPrintStreamAccessor.ErrorPrintStreamBuilder<?>>, org.refcodes.mixin.ErrorPrintStreamAccessor.ErrorPrintStreamMutator, org.refcodes.mixin.ErrorPrintStreamAccessor.ErrorPrintStreamPropertyorg.refcodes.logger.ColumnLayoutAccessor.ColumnLayoutBuilder<B extends org.refcodes.logger.ColumnLayoutAccessor.ColumnLayoutBuilder<B>>, org.refcodes.logger.ColumnLayoutAccessor.ColumnLayoutMutator, org.refcodes.logger.ColumnLayoutAccessor.ColumnLayoutProperty| 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 |
|---|---|
org.refcodes.logger.ColumnLayout |
getColumnLayout() |
PrintStream |
getErrorPrintStream() |
static ConsoleLoggerImpl |
getInstance()
Returns the singleton's instance as fabricated by this
ConsoleLoggerSingleton. |
int |
getRowWidth() |
PrintStream |
getStandardPrintStream() |
org.refcodes.textual.TableStyle |
getTableStyle() |
boolean |
hasEscapeCodes()
Checks for escape codes.
|
boolean |
hasLeftBorder()
Checks for left border.
|
boolean |
hasRightBorder()
Checks for right border.
|
void |
log(org.refcodes.tabular.Record<? extends Object> aRecord) |
void |
printSeparator() |
void |
setColumnLayout(org.refcodes.logger.ColumnLayout aColumnLayout) |
void |
setErrorPrintStream(PrintStream aErrStream) |
void |
setEscapeCodes(boolean isEscCodesEnabled)
Sets the escape codes.
|
void |
setLeftBorder(boolean hasLeftBorder)
Sets the left border.
|
void |
setLoggerLayout(String aLoggerLayout)
As the underlying configuration framework used by the
RuntimeLoggerSingleton cannot convert a String to an enum, we got
to provide such a method ourselves. |
void |
setLoggerStyle(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. |
void |
setRightBorder(boolean hasRightBorder)
Sets the right border.
|
void |
setRowWidth(int aRowWidth) |
void |
setStandardPrintStream(PrintStream aOutStream) |
void |
setTableStyle(org.refcodes.textual.TableStyle aTableStyle) |
ConsoleLoggerSingleton |
withErrorPrintStream(PrintStream aErrStream) |
ConsoleLoggerSingleton |
withEscapeCodes(boolean isEscCodesEnabled)
With escape codes.
|
ConsoleLoggerSingleton |
withLeftBorder(boolean hasLeftBorder)
With left border.
|
ConsoleLoggerSingleton |
withRightBorder(boolean hasRightBorder)
With right border.
|
ConsoleLoggerSingleton |
withRowWidth(int aRowWidth) |
ConsoleLoggerSingleton |
withStandardPrintStream(PrintStream aOutStream) |
ConsoleLoggerSingleton |
withTableStyle(org.refcodes.textual.TableStyle aTableStyle) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitwithColumnLayoutpublic 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 ConsoleLoggerImpl 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<? extends Object> aRecord) throws org.refcodes.logger.IllegalRecordRuntimeException, org.refcodes.logger.UnexpectedLogRuntimeException
log in interface org.refcodes.logger.Logger<Object>org.refcodes.logger.IllegalRecordRuntimeExceptionorg.refcodes.logger.UnexpectedLogRuntimeExceptionpublic PrintStream getStandardPrintStream()
getStandardPrintStream in interface org.refcodes.mixin.StandardPrintStreamAccessorpublic void setStandardPrintStream(PrintStream aOutStream)
setStandardPrintStream in interface org.refcodes.mixin.StandardPrintStreamAccessor.StandardPrintStreamMutatorpublic PrintStream getErrorPrintStream()
getErrorPrintStream in interface org.refcodes.mixin.ErrorPrintStreamAccessorpublic void setErrorPrintStream(PrintStream aErrStream)
setErrorPrintStream in interface org.refcodes.mixin.ErrorPrintStreamAccessor.ErrorPrintStreamMutatorpublic org.refcodes.textual.TableStyle getTableStyle()
getTableStyle in interface org.refcodes.textual.TableStyleAccessorpublic void setTableStyle(org.refcodes.textual.TableStyle aTableStyle)
setTableStyle in interface org.refcodes.textual.TableStyleAccessor.TableStyleMutatorpublic void setLoggerStyle(String aTableStyleName)
RuntimeLoggerSingleton cannot convert a String to an enum, we got
to provide such a method ourselves. When configuring programmatically use
TableStyleAccessor.TableStyleMutator.setTableStyle(TableStyle), when using the
"runtimelogger-config.xml" use the property "loggerStyle"
for this method to be invoked. Valid arguments are as of the
TableStyle enumeration:
setLoggerStyle in interface FormattedLogger<Object>aTableStyleName - The style to use for the logger.public void setEscapeCodes(boolean isEscCodesEnabled)
setEscapeCodes in interface FormattedLogger<Object>isEscCodesEnabled - the new escape codespublic boolean hasLeftBorder()
hasLeftBorder in interface FormattedLogger<Object>public void setLeftBorder(boolean hasLeftBorder)
setLeftBorder in interface FormattedLogger<Object>hasLeftBorder - the new left borderpublic boolean hasRightBorder()
hasRightBorder in interface FormattedLogger<Object>public void setRightBorder(boolean hasRightBorder)
setRightBorder in interface FormattedLogger<Object>hasRightBorder - the new right borderpublic int getRowWidth()
getRowWidth in interface org.refcodes.mixin.RowWidthAccessorpublic void setRowWidth(int aRowWidth)
setRowWidth in interface org.refcodes.mixin.RowWidthAccessor.RowWidthMutatorpublic void printSeparator()
printSeparator in interface org.refcodes.logger.Logger<Object>public ConsoleLoggerSingleton withStandardPrintStream(PrintStream aOutStream)
withStandardPrintStream in interface ConsoleLoggerwithStandardPrintStream in interface FormattedLogger<Object>withStandardPrintStream in interface org.refcodes.mixin.StandardPrintStreamAccessor.StandardPrintStreamBuilder<FormattedLogger<Object>>public ConsoleLoggerSingleton withErrorPrintStream(PrintStream aErrStream)
withErrorPrintStream in interface ConsoleLoggerwithErrorPrintStream in interface FormattedLogger<Object>withErrorPrintStream in interface org.refcodes.mixin.ErrorPrintStreamAccessor.ErrorPrintStreamBuilder<FormattedLogger<Object>>public ConsoleLoggerSingleton withTableStyle(org.refcodes.textual.TableStyle aTableStyle)
withTableStyle in interface ConsoleLoggerwithTableStyle in interface FormattedLogger<Object>withTableStyle in interface org.refcodes.textual.TableStyleAccessor.TableStyleBuilder<FormattedLogger<?>>public ConsoleLoggerSingleton withEscapeCodes(boolean isEscCodesEnabled)
withEscapeCodes in interface ConsoleLoggerwithEscapeCodes in interface FormattedLogger<Object>isEscCodesEnabled - the is esc codes enabledpublic ConsoleLoggerSingleton withLeftBorder(boolean hasLeftBorder)
withLeftBorder in interface ConsoleLoggerwithLeftBorder in interface FormattedLogger<Object>hasLeftBorder - the has left borderpublic ConsoleLoggerSingleton withRightBorder(boolean hasRightBorder)
withRightBorder in interface ConsoleLoggerwithRightBorder in interface FormattedLogger<Object>hasRightBorder - the has right borderpublic ConsoleLoggerSingleton withRowWidth(int aRowWidth)
withRowWidth in interface ConsoleLoggerwithRowWidth in interface FormattedLogger<Object>withRowWidth in interface org.refcodes.mixin.RowWidthAccessor.RowWidthBuilder<FormattedLogger<?>>public void setLoggerLayout(String aLoggerLayout)
RuntimeLoggerSingleton cannot convert a String to an enum, we got
to provide such a method ourselves. When configuring programmatically use
ColumnLayoutAccessor.ColumnLayoutMutator.setColumnLayout(ColumnLayout), when using the
"runtimelogger-config.xml" use the property "loggerLayout"
for this method to be invoked. Valid arguments are as of the
ColumnLayout enumeration:
setLoggerLayout in interface ConsoleLoggeraLoggerLayout - the new logger layoutpublic boolean hasEscapeCodes()
hasEscapeCodes in interface FormattedLogger<Object>public org.refcodes.logger.ColumnLayout getColumnLayout()
getColumnLayout in interface org.refcodes.logger.ColumnLayoutAccessorpublic void setColumnLayout(org.refcodes.logger.ColumnLayout aColumnLayout)
setColumnLayout in interface org.refcodes.logger.ColumnLayoutAccessor.ColumnLayoutMutatorCopyright © 2018. All rights reserved.