UNPKG

@livy/util

Version:
24 lines (23 loc) 701 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AbstractBatchFormatter = void 0; const environment_1 = require("../environment"); /** * Implements the `formatBatch` part of `FormatterInterface` * by concatenating individual formats with a newline character */ class AbstractBatchFormatter { constructor() { /** * A delimiter to join batch-formatted log records */ this.batchDelimiter = environment_1.EOL; } /** * @inheritdoc */ formatBatch(records) { return records.map(record => this.format(record)).join(this.batchDelimiter); } } exports.AbstractBatchFormatter = AbstractBatchFormatter;