From 1856e394f358832df4b86619cf1ee5b0864b71d0 Mon Sep 17 00:00:00 2001 From: Baris Usakli Date: Tue, 13 Aug 2013 15:25:40 -0400 Subject: [PATCH] more winston --- src/feed.js | 9 +++++---- src/login.js | 5 +++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/feed.js b/src/feed.js index e012850d4c..bdbab1d1e7 100644 --- a/src/feed.js +++ b/src/feed.js @@ -4,12 +4,13 @@ posts = require('./posts.js'), topics = require('./topics.js'), fs = require('fs'), - rss = require('node-rss'); + rss = require('node-rss'), + winston = require('winston'); function saveFeed(location, feed) { fs.writeFile(location, rss.getFeedXML(feed), function (err) { if(err) { - console.log(err); + winston.err(err); } }); } @@ -32,7 +33,7 @@ var cache_time_in_seconds = 60; topics.getTopicWithPosts(tid, 0, function(err, topicData) { - if (err) console.log('Error: Problem saving topic RSS feed', err); + if (err) winston.error('Problem saving topic RSS feed', err.stack); var location = '/topic/' + topicData.slug, xml_url = '/topic/' + tid + '.rss'; @@ -69,7 +70,7 @@ Feed.updateCategory = function(cid) { categories.getCategoryById(cid, 0, function(err, categoryData) { if (err) { - console.log('Error: Could not update RSS feed for category ' + cid); + winston.error('Could not update RSS feed for category ' + cid, err.stack); return; } diff --git a/src/login.js b/src/login.js index b0c8716660..0e8a1a0d7d 100644 --- a/src/login.js +++ b/src/login.js @@ -2,7 +2,8 @@ var user = require('./user.js'), bcrypt = require('bcrypt'), RDB = require('./redis.js'), - path = require('path'); + path = require('path'), + winston = require('winston'); (function(Login){ @@ -27,7 +28,7 @@ var user = require('./user.js'), user.getUserField(uid, 'password', function(user_password) { bcrypt.compare(password, user_password, function(err, res) { if(err) { - console.log(err); + winston.err(err); next({ status: "error", message: 'bcrypt compare error'