mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-07-19 21:51:48 +02:00
realized I forgot to add the actual logger
This commit is contained in:
32
config/logger.js
Normal file
32
config/logger.js
Normal 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;
|
||||
}
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user