UNPKG

@livy/util

Version:
20 lines (19 loc) 512 B
import { EOL } from '../environment.mjs'; /** * Implements the `formatBatch` part of `FormatterInterface` * by concatenating individual formats with a newline character */ export class AbstractBatchFormatter { constructor() { /** * A delimiter to join batch-formatted log records */ this.batchDelimiter = EOL; } /** * @inheritdoc */ formatBatch(records) { return records.map(record => this.format(record)).join(this.batchDelimiter); } }