我的记录文件
var winston = require('winston');
winston.add(winston.transports.File, { filename: 'somefile.log' });
var config = {'status':1};
我的js文件,
log = require('../../../config/logs.js');
exports.getcategories = function (req, res) {
i want to write a if condition to check status in my log file
if(log.config.status == 1)
console.log(log)
Categories.find(item, function (err, result) {
if (err) {
console.log('err');
}
data = { status: 'fail', error_code: 1, result: [] };
if (result) {
data = { status: 'success', error_code: 0, result: result };
}
res.json(data);
});
};
我不确定我遵循的程序,cn任何人请帮助我.........