Class ConsoleLoggerImpl

  • All Implemented Interfaces:
    org.refcodes.component.Destroyable, ConsoleLogger, FormattedLogger<java.lang.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<java.lang.Object>, org.refcodes.mixin.ErrorPrintStreamAccessor, org.refcodes.mixin.ErrorPrintStreamAccessor.ErrorPrintStreamBuilder<FormattedLogger<java.lang.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<java.lang.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 ConsoleLoggerImpl
    extends FormattedLoggerImpl<java.lang.Object>
    implements ConsoleLogger
    Specialized subclass of the FormattedLoggerImpl for handling RuntimeLogger's logs with ANSI Escape-Codes.
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.refcodes.logger.ColumnLayoutAccessor

        org.refcodes.logger.ColumnLayoutAccessor.ColumnLayoutBuilder<B extends org.refcodes.logger.ColumnLayoutAccessor.ColumnLayoutBuilder<B>>, org.refcodes.logger.ColumnLayoutAccessor.ColumnLayoutMutator, org.refcodes.logger.ColumnLayoutAccessor.ColumnLayoutProperty
      • Nested classes/interfaces inherited from interface org.refcodes.component.Destroyable

        org.refcodes.component.Destroyable.DestroyAutomaton
      • Nested classes/interfaces inherited from interface org.refcodes.mixin.ErrorPrintStreamAccessor

        org.refcodes.mixin.ErrorPrintStreamAccessor.ErrorPrintStreamBuilder<B extends org.refcodes.mixin.ErrorPrintStreamAccessor.ErrorPrintStreamBuilder<?>>, org.refcodes.mixin.ErrorPrintStreamAccessor.ErrorPrintStreamMutator, org.refcodes.mixin.ErrorPrintStreamAccessor.ErrorPrintStreamProperty
      • Nested classes/interfaces inherited from interface org.refcodes.mixin.RowWidthAccessor

        org.refcodes.mixin.RowWidthAccessor.RowWidthBuilder<B extends org.refcodes.mixin.RowWidthAccessor.RowWidthBuilder<?>>, org.refcodes.mixin.RowWidthAccessor.RowWidthMutator, org.refcodes.mixin.RowWidthAccessor.RowWidthProperty
      • Nested classes/interfaces inherited from interface org.refcodes.mixin.StandardPrintStreamAccessor

        org.refcodes.mixin.StandardPrintStreamAccessor.StandardPrintStreamBuilder<B extends org.refcodes.mixin.StandardPrintStreamAccessor.StandardPrintStreamBuilder<?>>, org.refcodes.mixin.StandardPrintStreamAccessor.StandardPrintStreamMutator, org.refcodes.mixin.StandardPrintStreamAccessor.StandardPrintStreamProperty
      • Nested classes/interfaces inherited from interface org.refcodes.textual.TableStyleAccessor

        org.refcodes.textual.TableStyleAccessor.TableStyleBuilder<B extends org.refcodes.textual.TableStyleAccessor.TableStyleBuilder<?>>, org.refcodes.textual.TableStyleAccessor.TableStyleMutator, org.refcodes.textual.TableStyleAccessor.TableStyleProperty
    • Constructor Summary

      Constructors 
      Constructor Description
      ConsoleLoggerImpl()
      Instantiates a new console logger impl.
      ConsoleLoggerImpl​(org.refcodes.logger.ColumnLayout aLoggerLayout)
      Instantiates a new console logger impl.
    • Field Detail

      • _errorBuilder

        protected org.refcodes.textual.TableBuilder _errorBuilder
      • _standardBuilder

        protected org.refcodes.textual.TableBuilder _standardBuilder
      • _standardHeader

        protected org.refcodes.tabular.FormattedHeader<java.lang.Object> _standardHeader
    • Constructor Detail

      • ConsoleLoggerImpl

        public ConsoleLoggerImpl()
        Instantiates a new console logger impl.
      • ConsoleLoggerImpl

        public ConsoleLoggerImpl​(org.refcodes.logger.ColumnLayout aLoggerLayout)
        Instantiates a new console logger impl.
        Parameters:
        aLoggerLayout - the logger layout
    • Method Detail

      • getColumnLayout

        public org.refcodes.logger.ColumnLayout getColumnLayout()
        Specified by:
        getColumnLayout in interface org.refcodes.logger.ColumnLayoutAccessor
      • setColumnLayout

        public void setColumnLayout​(org.refcodes.logger.ColumnLayout aColumnLayout)
        Specified by:
        setColumnLayout in interface org.refcodes.logger.ColumnLayoutAccessor.ColumnLayoutMutator
      • log

        public void log​(org.refcodes.tabular.Record<? extends java.lang.Object> aRecord)
                 throws org.refcodes.logger.IllegalRecordRuntimeException,
                        org.refcodes.logger.UnexpectedLogRuntimeException
        Specified by:
        log in interface org.refcodes.logger.Logger<java.lang.Object>
        Overrides:
        log in class FormattedLoggerImpl<java.lang.Object>
        Throws:
        org.refcodes.logger.IllegalRecordRuntimeException
        org.refcodes.logger.UnexpectedLogRuntimeException
      • printException

        protected void printException​(java.lang.Exception theException)
        Prints the exception.
        Parameters:
        theException - the the exception
      • printSeparator

        public void printSeparator()
        Specified by:
        printSeparator in interface org.refcodes.logger.Logger<java.lang.Object>
      • toLoggerLayout

        protected static org.refcodes.logger.ColumnLayout toLoggerLayout​(org.refcodes.logger.ColumnLayout aLoggerLayout)
        Determines the ColumnLayout by evaluating the SystemProperty.LOGGER_LAYOUT and the EnvironmentVariable.LOGGER_LAYOUT (in this order). If none (valid) layout was determinable, then the ColumnLayout.SUPERUSER is returned.
        Parameters:
        aLoggerLayout - the logger layout
        Returns:
        The ColumnLayout to be used.
      • toLoggerLayout

        protected static org.refcodes.logger.ColumnLayout toLoggerLayout()
        To logger layout.
        Returns:
        the column layout
      • toShortcutLoggerStyle

        protected static org.refcodes.textual.TableStyle toShortcutLoggerStyle()
        Determines the TableStyle by evaluating the SystemProperty.LOGGER_STYLE and the EnvironmentVariable.LOGGER_STYLE (in this order). If none (valid) style was determinable, then a proposed style is returned.
        Returns:
        The TableStyle to be used.
      • printTail

        protected void printTail()
        Hook for using the right logger for printing the tail. Overwritten by sub-classes.
        Overrides:
        printTail in class FormattedLoggerImpl<java.lang.Object>