Skip to main content

abstractTransport <Options>

Hierarchy

Implements

Index

Constructors

constructor

  • new Transport<Options>(options: Options): Transport<Options>

Properties

readonlylevels

levels: LogLevel[] = []

readonlyoptions

options: Readonly<Required<Options>>

Validated and configured options.

Methods

blueprint

configure

  • configure(options?: Partial<Options> | (options: Required<Options>) => Partial<Options>): Readonly<Required<Options>>
  • Set an options object by merging the new partial and existing options with the defined blueprint, while running all validation checks. Freeze and return the options object.

    object.configure({ name: 'Boost' });

    object.configure((prevOptions) => ({
    nestedObject: {
    ...prevOptions.nestedObject,
    some: 'value',
    },
    }));

format

  • Format the log item into a message string, and append a trailing newline if missing.

abstractwrite

  • write(message: string, item: LogItem): void | Promise<void>
  • Write the formatted message according to the transport.