summaryrefslogtreecommitdiff
path: root/lib/temp.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/temp.js')
-rw-r--r--lib/temp.js13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/temp.js b/lib/temp.js
index 90d9343f..b635644d 100644
--- a/lib/temp.js
+++ b/lib/temp.js
@@ -4,6 +4,7 @@ var mongoose = require('mongoose');
//core
var config = require("../config.js");
+var logger = require("./logger.js");
// create a temp model
var model = mongoose.model('temp', {
@@ -33,13 +34,13 @@ function findTemp(id, callback) {
id: id
}, function (err, temp) {
if (err) {
- console.log('find temp failed: ' + err);
+ logger.error('find temp failed: ' + err);
callback(err, null);
}
if (!err && temp) {
callback(null, temp);
} else {
- console.log('find temp failed: ' + err);
+ logger.error('find temp failed: ' + err);
callback(err, null);
};
});
@@ -53,10 +54,10 @@ function newTemp(id, data, callback) {
});
temp.save(function (err) {
if (err) {
- console.log('new temp failed: ' + err);
+ logger.error('new temp failed: ' + err);
callback(err, null);
} else {
- console.log("new temp success: " + temp.id);
+ logger.info("new temp success: " + temp.id);
callback(null, temp);
};
});
@@ -67,14 +68,14 @@ function removeTemp(id, callback) {
if(!err && temp) {
temp.remove(function(err) {
if(err) {
- console.log('remove temp failed: ' + err);
+ logger.error('remove temp failed: ' + err);
callback(err, null);
} else {
callback(null, null);
}
});
} else {
- console.log('remove temp failed: ' + err);
+ logger.error('remove temp failed: ' + err);
callback(err, null);
}
});