realized I forgot to add the actual logger

This commit is contained in:
Liran Tal
2014-11-06 13:17:17 +02:00
parent bf7bcc6170
commit d2d4e8c865

32
config/logger.js Normal file
View File

@@ -0,0 +1,32 @@
'use strict';
/**
* Module dependencies.
*/
var morgan = require('morgan');
var config = require('./config');
var fs = require('fs');
/**
* Module init function.
*/
module.exports = {
getLogFormat: function() {
return config.log.format;
},
getLogOptions: function() {
var options = {};
if ('stream' in config.log.options) {
options = {
stream: fs.createWriteStream(process.cwd() + '/' + config.log.options.stream, {flags: 'a'})
};
}
return options;
}
};