diff --git a/index.js b/index.js index 95ce065..0ede917 100644 --- a/index.js +++ b/index.js @@ -1,5 +1,5 @@ +const moment = require('moment') const libs = require('./libs') - const config = require('./config') setInterval(() => { @@ -9,7 +9,7 @@ setInterval(() => { // On récupére en base le précédent morceau joué libs.getLastSong((err, last) => { if (err) { - console.log(err) + console.log('[ERR] GET LAST SONG:', moment().format(), err) return false } @@ -20,14 +20,14 @@ setInterval(() => { // On sauvegarde en base le morceau en cours de diffusion libs.saveSong(currentSong, (err, savedSond) => { if (err) { - console.log('ERR:', err) + console.log('[ERR] SAVE SONG:', moment().format(), err) return false } // On récupère la cover du morceau actuel libs.findCover(currentSong, (err, coverUrl) => { if (err) { - console.log('ERR:', err) + console.log('[ERR] FIND COVER:', moment().format(), err) return false } diff --git a/package.json b/package.json index 2e975ec..f72f004 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "dependencies": { "disconnect": "^1.2.1", "mastodon": "^1.2.2", + "moment": "^2.24.0", "mongoose": "^5.7.13", "request": "^2.88.0" }, @@ -20,4 +21,4 @@ "eslint-plugin-standard": "^4.0.1", "nodemon": "^2.0.1" } -} \ No newline at end of file +} diff --git a/yarn.lock b/yarn.lock index 624bfb0..2c7a309 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1280,6 +1280,11 @@ mkdirp@^0.5.1: dependencies: minimist "0.0.8" +moment@^2.24.0: + version "2.24.0" + resolved "https://registry.yarnpkg.com/moment/-/moment-2.24.0.tgz#0d055d53f5052aa653c9f6eb68bb5d12bf5c2b5b" + integrity sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg== + mongodb@3.3.5: version "3.3.5" resolved "https://registry.yarnpkg.com/mongodb/-/mongodb-3.3.5.tgz#38d531013afede92b0dd282e3b9f3c08c9bdff3b"