@livy/util
Version:
Common utilities for the Livy logger
20 lines (19 loc) • 512 B
JavaScript
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);
}
}