Class ColorConsoleAppender

Appends styled messages to the console. Only available on servers, i.e. terminals supporting colors.

Hierarchy (view full)

Constructors

Properties

_buffer: LogMessage[]

A buffer that will be filled with log messages until the Appender is writable.

_filterRelation: FilterRelation

The relation, to which all the appenders results must adhere. See FilterRelation.

_filters: Filter[]

The filter that will be evaluated in order to determine whether a message shall be handled by this appender.

ageLookup: string[] = DefaultFormats.ENUMS.AGE
autoColors: string[] = ...

List of styles to choose from when generating random styles.

categoryStyle: StyleLookupEntry[] = []

Array containing category style rules. Will be generated according to the category style option specified.

dayOfTheWeekLookup: string[] = DefaultFormats.ENUMS.DAY_OF_WEEK
defaultStyle: string = Colors.DEFAULT
format: string

The log message format to use. All properties of a log message can be inserted to their placeholders, e.g. '%id%'.

idStyle: string = DefaultStyles.ID
messageStyle: string = DefaultStyles.MESSAGE
monthLookup: string[] = DefaultFormats.ENUMS.MONTH
noonLookup: string[] = DefaultFormats.ENUMS.NOON
originStyle: string = DefaultStyles.ORIGIN
refStyle: StyleLookupEntry[] = []

Array containing ref style rules. Will be generated according to the refStyle option specified.

separatorLookup: string[] = DefaultFormats.ENUMS.SEPARATOR
severityLookup: string[] = DefaultFormats.ENUMS.SEVERITY

A simple lookup from where the strings for the severity levels can be fetched. see DefaultFormats.ENUMS.SEVERITY

severityStyle: StyleLookupEntry[] = []

Array containing severity style rules. Will be generated according to the severity style option specified.

styleAutoGenerators: RandomStyleGeneratorFactory[] = []

Array if style auto generator functions, indexed by the RandomizedStylableLogMessageProperties enum values.

timeFormat: string

The time format to use for the %time% placeholder. The time format is inspired by https://msdn.microsoft.com/de-de/library/8kb3ddd4(v=vs.110).aspx, but some of the placeholders might not work.

timeStyle: string = DefaultStyles.TIME

Accessors

Methods

  • Returns the style setting selected from the style lookup entries specified. If no filter matches, undefined returned.

    Parameters

    Returns undefined | string

    A style string;

  • The input function of an Appender for any log message. This function calls the filter evaluation, and hands the message over to the _handleMessage method, if the appender is currently writable. If the appender is not writable, the message is stored to the internal buffer.

    Parameters

    • msg: LogMessage

      The message that shall be received and appended.

    Returns boolean

    True, if the message was handled, false otherwise.