@swell/cli
Version:
Swell's command line interface/utility
14 lines (13 loc) • 401 B
JavaScript
import { Output } from './output.js';
const COLUMN_NAMES_TO_HIDE = new Set(['date', 'request']);
export class LineOutput extends Output {
prepareData(log) {
return this.columns.map((c) => {
const logValue = log[c];
return COLUMN_NAMES_TO_HIDE.has(c) ? logValue : `${c}: ${logValue}`;
});
}
write(row) {
console.log(row.join(' - '));
}
}