Options
All
  • Public
  • Public/Protected
  • All
Menu

Class LogChannel<T>

The class LogChannel allows to broadcast Log to multiple destinations using a user defined filtering (selection of logs) and mapping (transformation of selected logs before emission).

This class is a companion of Context.

Type parameters

  • T = unknown

Hierarchy

  • LogChannel

Index

Constructors

Properties

Methods

Constructors

constructor

  • new LogChannel<T>(__namedParameters: { filter: (data: Log) => boolean; map?: (data: Log) => T; pipes: Subject<T>[] }): LogChannel<T>
  • Type parameters

    • T = unknown

    Parameters

    • __namedParameters: { filter: (data: Log) => boolean; map?: (data: Log) => T; pipes: Subject<T>[] }
      • filter: (data: Log) => boolean

        see filter

          • (data: Log): boolean
          • Parameters

            Returns boolean

      • Optional map?: (data: Log) => T

        see map

          • (data: Log): T
          • Parameters

            Returns T

      • pipes: Subject<T>[]

        see pipes

    Returns LogChannel<T>

Properties

filter

filter: (data: Log) => boolean

User defined function that return whether or not a Log should be broadcasted

Type declaration

    • (data: Log): boolean
    • Parameters

      Returns boolean

map

map: (data: Log) => T

User defined function that, if provided, transform the selected logs into a target type of message. If not provided at construction the function identity is used.

Type declaration

    • (data: Log): T
    • Parameters

      Returns T

pipes

pipes: Subject<T>[]

A list of consumers of the messages as RxJs subjects

Methods

dispatch

  • dispatch(log: Log): void

Generated using TypeDoc