Only log errors

This commit is contained in:
GotPPay
2017-11-22 12:37:51 +01:00
parent 9d9110bf63
commit 755973e42d
4 changed files with 12 additions and 14 deletions

View File

@@ -12,10 +12,10 @@ export default class MongoSaver {
if (!saver.ready) {
MongoClient.connect(saver.url, (err, db) => {
if (err) {
console.log('Unable to connect to the mongoDB server. Error:', err);
console.log('[E] Unable to connect to the mongoDB server. Error:', err);
reject(err);
} else {
console.log('Connection established to', this.url);
//console.log('[I] Connection established to', this.url);
saver.db = db;
saver.collection = db.collection('listings');
saver.ready = true;
@@ -43,7 +43,7 @@ export default class MongoSaver {
//Close connection
await this.disconnect();
} catch (e) {
console.log("error closing", e);
console.log("[E] Error closing connection", e);
}
}