Function logline

  • A tagged string prefix that creates a processed log line.

    The returned log line can be used in any form:

    logger.info(...logline`Logged value: ${value}`); // Explicitly expand the log line.
    logger.info(logline`Logged value: ${value}`); // The log line will be expanded by logger.

    The log line formatted accordingly to the following rules:

    1. Template strings and values not separated by whitespace joined into single string.
    2. The values separated by whitespaces are added to the log line as is.
    3. Template strings trimmed.
    4. Any number of subsequent whitespaces in template strings replaced with single space.
    5. Leading and/or trailing template string removed if it became empty.

    All Loggable values processed before being joined into string. They may be processed as many times as requested. The final joining happens at the output ('out') or default (undefined)logging.

    Parameters

    • strings: TemplateStringsArray
    • Rest ...args: readonly unknown[]

    Returns unknown[] & Loggable

    Processed log line additionally implementing Loggable interface.

Generated using TypeDoc