From c5f269c0a7e57896c8c33223c9a27306585339e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Sun, 22 Aug 2021 20:50:48 +0300 Subject: [PATCH] Added logger to ready.js --- src/client/events/ready.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/client/events/ready.js b/src/client/events/ready.js index c4e796f..8e62a5d 100644 --- a/src/client/events/ready.js +++ b/src/client/events/ready.js @@ -21,19 +21,25 @@ module.exports = { } try { + client.funcs.logger('Stations', 'Started fetching list – ' + client.config.stationslistUrl); client.stations = await fetch(client.config.stationslistUrl) .then(client.funcs.checkFetchStatus) .then(response => response.json()); + client.funcs.logger('Stations', 'Successfully fetched list' + "\n"); } catch (error) { - //console.error(error); + client.funcs.logger('Stations', ' Fetching list failed'); + console.error(error + "\n"); } setInterval(async () => { try { + client.funcs.logger('Stations' + 'Started fetching list – ' + client.config.stationslistUrl); client.stations = await fetch(client.config.stationslistUrl) .then(client.funcs.checkFetchStatus) .then(response => response.json()); + console.log('Stations', 'Successfully fetched list' + "\n"); } catch (error) { + client.funcs.logger('Stations', 'Fetching list failed'); //console.error(error); } }, 3600000);