ConsoleLogger
, FormattedLogger<Object>
, org.refcodes.logger.ColumnLayoutAccessor
, org.refcodes.logger.ColumnLayoutAccessor.ColumnLayoutBuilder<ConsoleLogger>
, org.refcodes.logger.ColumnLayoutAccessor.ColumnLayoutMutator
, org.refcodes.logger.ColumnLayoutAccessor.ColumnLayoutProperty
, org.refcodes.logger.Logger<Object>
, org.refcodes.mixin.ErrorPrintStreamAccessor
, org.refcodes.mixin.ErrorPrintStreamAccessor.ErrorPrintStreamBuilder<FormattedLogger<Object>>
, org.refcodes.mixin.ErrorPrintStreamAccessor.ErrorPrintStreamMutator
, org.refcodes.mixin.ErrorPrintStreamAccessor.ErrorPrintStreamProperty
, org.refcodes.mixin.RowWidthAccessor
, org.refcodes.mixin.RowWidthAccessor.RowWidthBuilder<FormattedLogger<?>>
, org.refcodes.mixin.RowWidthAccessor.RowWidthMutator
, org.refcodes.mixin.RowWidthAccessor.RowWidthProperty
, org.refcodes.mixin.StandardPrintStreamAccessor
, org.refcodes.mixin.StandardPrintStreamAccessor.StandardPrintStreamBuilder<FormattedLogger<Object>>
, org.refcodes.mixin.StandardPrintStreamAccessor.StandardPrintStreamMutator
, org.refcodes.mixin.StandardPrintStreamAccessor.StandardPrintStreamProperty
, org.refcodes.textual.TableStyleAccessor
, org.refcodes.textual.TableStyleAccessor.TableStyleBuilder<FormattedLogger<?>>
, org.refcodes.textual.TableStyleAccessor.TableStyleMutator
, org.refcodes.textual.TableStyleAccessor.TableStyleProperty
public class ConsoleLoggerSingleton extends Object implements ConsoleLogger
ConsoleLoggerSingleton
provides a ConsoleLoggerImpl
singleton .org.refcodes.logger.ColumnLayoutAccessor.ColumnLayoutBuilder<B extends org.refcodes.logger.ColumnLayoutAccessor.ColumnLayoutBuilder<B>>, org.refcodes.logger.ColumnLayoutAccessor.ColumnLayoutMutator, org.refcodes.logger.ColumnLayoutAccessor.ColumnLayoutProperty
org.refcodes.mixin.ErrorPrintStreamAccessor.ErrorPrintStreamBuilder<B extends org.refcodes.mixin.ErrorPrintStreamAccessor.ErrorPrintStreamBuilder<?>>, org.refcodes.mixin.ErrorPrintStreamAccessor.ErrorPrintStreamMutator, org.refcodes.mixin.ErrorPrintStreamAccessor.ErrorPrintStreamProperty
org.refcodes.mixin.RowWidthAccessor.RowWidthBuilder<B extends org.refcodes.mixin.RowWidthAccessor.RowWidthBuilder<?>>, org.refcodes.mixin.RowWidthAccessor.RowWidthMutator, org.refcodes.mixin.RowWidthAccessor.RowWidthProperty
org.refcodes.mixin.StandardPrintStreamAccessor.StandardPrintStreamBuilder<B extends org.refcodes.mixin.StandardPrintStreamAccessor.StandardPrintStreamBuilder<?>>, org.refcodes.mixin.StandardPrintStreamAccessor.StandardPrintStreamMutator, org.refcodes.mixin.StandardPrintStreamAccessor.StandardPrintStreamProperty
org.refcodes.textual.TableStyleAccessor.TableStyleBuilder<B extends org.refcodes.textual.TableStyleAccessor.TableStyleBuilder<?>>, org.refcodes.textual.TableStyleAccessor.TableStyleMutator, org.refcodes.textual.TableStyleAccessor.TableStyleProperty
Constructor | 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 | 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) |
withColumnLayout
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 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.IllegalRecordRuntimeException
org.refcodes.logger.UnexpectedLogRuntimeException
public PrintStream getStandardPrintStream()
getStandardPrintStream
in interface org.refcodes.mixin.StandardPrintStreamAccessor
public void setStandardPrintStream(PrintStream aOutStream)
setStandardPrintStream
in interface org.refcodes.mixin.StandardPrintStreamAccessor.StandardPrintStreamMutator
public PrintStream getErrorPrintStream()
getErrorPrintStream
in interface org.refcodes.mixin.ErrorPrintStreamAccessor
public void setErrorPrintStream(PrintStream aErrStream)
setErrorPrintStream
in interface org.refcodes.mixin.ErrorPrintStreamAccessor.ErrorPrintStreamMutator
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 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.RowWidthAccessor
public void setRowWidth(int aRowWidth)
setRowWidth
in interface org.refcodes.mixin.RowWidthAccessor.RowWidthMutator
public void printSeparator()
printSeparator
in interface org.refcodes.logger.Logger<Object>
public ConsoleLoggerSingleton withStandardPrintStream(PrintStream aOutStream)
withStandardPrintStream
in interface ConsoleLogger
withStandardPrintStream
in interface FormattedLogger<Object>
withStandardPrintStream
in interface org.refcodes.mixin.StandardPrintStreamAccessor.StandardPrintStreamBuilder<FormattedLogger<Object>>
public ConsoleLoggerSingleton withErrorPrintStream(PrintStream aErrStream)
withErrorPrintStream
in interface ConsoleLogger
withErrorPrintStream
in interface org.refcodes.mixin.ErrorPrintStreamAccessor.ErrorPrintStreamBuilder<FormattedLogger<Object>>
withErrorPrintStream
in interface FormattedLogger<Object>
public ConsoleLoggerSingleton withTableStyle(org.refcodes.textual.TableStyle aTableStyle)
withTableStyle
in interface ConsoleLogger
withTableStyle
in interface FormattedLogger<Object>
withTableStyle
in interface org.refcodes.textual.TableStyleAccessor.TableStyleBuilder<FormattedLogger<?>>
public ConsoleLoggerSingleton withEscapeCodes(boolean isEscCodesEnabled)
withEscapeCodes
in interface ConsoleLogger
withEscapeCodes
in interface FormattedLogger<Object>
isEscCodesEnabled
- the is esc codes enabledpublic ConsoleLoggerSingleton withLeftBorder(boolean hasLeftBorder)
withLeftBorder
in interface ConsoleLogger
withLeftBorder
in interface FormattedLogger<Object>
hasLeftBorder
- the has left borderpublic ConsoleLoggerSingleton withRightBorder(boolean hasRightBorder)
withRightBorder
in interface ConsoleLogger
withRightBorder
in interface FormattedLogger<Object>
hasRightBorder
- the has right borderpublic ConsoleLoggerSingleton withRowWidth(int aRowWidth)
withRowWidth
in interface ConsoleLogger
withRowWidth
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 ConsoleLogger
aLoggerLayout
- the new logger layoutpublic boolean hasEscapeCodes()
hasEscapeCodes
in interface FormattedLogger<Object>
public org.refcodes.logger.ColumnLayout getColumnLayout()
getColumnLayout
in interface org.refcodes.logger.ColumnLayoutAccessor
public void setColumnLayout(org.refcodes.logger.ColumnLayout aColumnLayout)
setColumnLayout
in interface org.refcodes.logger.ColumnLayoutAccessor.ColumnLayoutMutator
Copyright © 2018. All rights reserved.