Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace log

Logging integration for state; provides callbacks for logging events thereby allowing integration of third party logging tools.

Index

Variables

Const Create

Create: 1 = 1

Logging category used when new state machine elements are created.

Const Entry

Entry: 2 = 2

Logging category used when states are entered during state machine instance initialisation or state transitions.

Const Evaluate

Evaluate: 8 = 8

Logging category used when trigger events are evaluated during state transitions.

Const Exit

Exit: 4 = 4

Logging category used when states are exited during state machine instance initialisation or state transitions.

Const Transition

Transition: 16 = 16

Logging category used when state transitions are traversed.

Const User

User: 128 = 128

Logging category used for user generated log events.

Functions

add

  • add(consumer: Consumer<string>, ...categories: number[]): number
  • Adds a new log event consumer that will be called when log events of a particular category or categories are raised.

    Parameters

    • consumer: Consumer<string>

      The callback that will be invoked with the log message.

    • Rest ...categories: number[]

      The categorory or categories for which the consumer callback will be invoked.

    Returns number

    Returns an id for the consumer so that it can be removed if desired.

remove

  • remove(index: number): void
  • Removes a log event consumer.

    Parameters

    • index: number

      The id of the consumer previously returned by the add function.

    Returns void

write

  • write(producer: Producer<string>, category: number): void
  • Raises a log event

    remarks

    The producer callback will only be called if there is a registered consumer for the category of message.

    Parameters

    • producer: Producer<string>

      A callback used to generate the log message.

    • category: number

      The category of message.

    Returns void

Generated using TypeDoc