Class KV<T>

Allow adding of a simple key/value pair to a log. When multiple key is detected, the first key logged prevails over subsequent value assigned to the same key

Type Parameters

Hierarchy

Constructors

Properties

Accessors

Methods

Constructors

Properties

_key: string
_value: T

Accessors

  • get key(): string
  • Returns string

  • get value(): T | T[]
  • Returns T | T[]

Methods

  • Merge list of KVs if duplicate keys found, convert the value into an array.

    N.B.: Use this method with caution as downstream system such as logstash does not like when datatype of a key changes. It could result in the log being missed.

    Returns

    Type Parameters

    Parameters

    Returns IJson

  • Factory method for KV

    Returns

    Type Parameters

    Parameters

    • key: string
    • value: T

    Returns KV<T>

Generated using TypeDoc