node-test-bed-adapter
Version:
An adapter to connect a node.js application to the Test-bed's Common Information Space or Common Simulation Space.
21 lines • 490 B
JavaScript
import { appendFile } from 'fs';
/**
* A simple file logger that appends the text to a log file.
*/
export class FileLogger {
file;
constructor(file) {
this.file = file;
}
log(_level, msg, callback) {
appendFile(this.file, msg + '\n', (err) => {
if (callback) {
return callback(err, null);
}
if (err) {
throw err;
}
});
}
}
//# sourceMappingURL=file-logger.mjs.map