Skip to main content

ConsoleTransport

Hierarchy

Index

Constructors

constructor

Properties

readonlylevels

levels: LogLevel[] = []

readonlyoptions

options: Readonly<Required<TransportOptions>>

Validated and configured options.

Methods

blueprint

configure

  • 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.

write

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