mirror of
https://github.com/nttgin/BGPalerter.git
synced 2024-05-19 06:50:08 +00:00
trycatch in case the log stream is not available
This commit is contained in:
@@ -68,12 +68,15 @@ export default class FileLogger {
|
||||
};
|
||||
|
||||
log = (data) => {
|
||||
|
||||
try {
|
||||
const item = this.format({
|
||||
timestamp: this.getCurrentDate().format('YYYY-MM-DDTHH:mm:ssZ'),
|
||||
data
|
||||
});
|
||||
|
||||
this.stream.write(item + "\n");
|
||||
} catch (error) {
|
||||
console.log(data);
|
||||
console.log(error);
|
||||
}
|
||||
};
|
||||
};
|
Reference in New Issue
Block a user