You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

29 lines
509 B

const debug = require('debug')('log4js:recording');
const recordedEvents = [];
function configure() {
return function (logEvent) {
debug(
`received logEvent, number of events now ${recordedEvents.length + 1}`
);
debug('log event was ', logEvent);
recordedEvents.push(logEvent);
};
}
function replay() {
return recordedEvents.slice();
}
function reset() {
recordedEvents.length = 0;
}
module.exports = {
configure,
replay,
playback: replay,
reset,
erase: reset,
};