Improve printing to console

This commit is contained in:
Adam Stachowicz 2021-07-17 23:13:54 +02:00
parent 78f5d2cd8b
commit 2bff62cade
3 changed files with 10 additions and 10 deletions

View file

@ -15,7 +15,7 @@ class Notification {
}) })
return true; return true;
} catch (error) { } catch (error) {
console.log(error) console.error(error)
return false; return false;
} }
@ -31,7 +31,7 @@ class Notification {
}) })
return true; return true;
} catch (error) { } catch (error) {
console.log(error) console.error(error)
return false; return false;
} }
@ -61,7 +61,7 @@ class Notification {
let res = await axios.post(notification.webhookURL, finalData, config) let res = await axios.post(notification.webhookURL, finalData, config)
return true; return true;
} catch (error) { } catch (error) {
console.log(error) console.error(error)
return false; return false;
} }
@ -105,7 +105,7 @@ class Notification {
let res = await axios.post(notification.discordWebhookUrl, data) let res = await axios.post(notification.discordWebhookUrl, data)
return true; return true;
} catch(error) { } catch(error) {
console.log(error) console.error(error)
return false; return false;
} }
@ -121,10 +121,10 @@ class Notification {
let res = await axios.post(notification.signalURL, data, config) let res = await axios.post(notification.signalURL, data, config)
return true; return true;
} catch (error) { } catch (error) {
console.log(error) console.error(error)
return false; return false;
} }
} else if (notification.type === "slack") { } else if (notification.type === "slack") {
try { try {
if (heartbeatJSON == null) { if (heartbeatJSON == null) {
@ -173,7 +173,7 @@ class Notification {
let res = await axios.post(notification.slackwebhookURL, data) let res = await axios.post(notification.slackwebhookURL, data)
return true; return true;
} catch (error) { } catch (error) {
console.log(error) console.error(error)
return false; return false;
} }

View file

@ -19,7 +19,7 @@ const version = require('../package.json').version;
const hostname = args.host || "0.0.0.0" const hostname = args.host || "0.0.0.0"
const port = args.port || 3001 const port = args.port || 3001
console.log("Version: " + version) console.info("Version: " + version)
console.log("Creating express and socket.io instance") console.log("Creating express and socket.io instance")
const app = express(); const app = express();
@ -236,7 +236,7 @@ let needSetup = false;
}); });
} catch (e) { } catch (e) {
console.log(e) console.error(e)
callback({ callback({
ok: false, ok: false,
msg: e.message msg: e.message

View file

@ -394,7 +394,7 @@ export function timezoneList() {
time: getTimezoneOffset(timezone), time: getTimezoneOffset(timezone),
}) })
} catch (e) { } catch (e) {
console.log(e.message); console.error(e.message);
console.log("Skip this timezone") console.log("Skip this timezone")
} }