From d2d4e8c8659f3b90b0ebf0da0bad262792c0c21e Mon Sep 17 00:00:00 2001 From: Liran Tal Date: Thu, 6 Nov 2014 13:17:17 +0200 Subject: [PATCH] realized I forgot to add the actual logger --- config/logger.js | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 config/logger.js diff --git a/config/logger.js b/config/logger.js new file mode 100644 index 0000000000..5acfb8c033 --- /dev/null +++ b/config/logger.js @@ -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; + } + +}; \ No newline at end of file