mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-01-28 18:19:23 +01:00
36 lines
539 B
JavaScript
36 lines
539 B
JavaScript
'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 = {};
|
|
|
|
try {
|
|
if ('stream' in config.log.options) {
|
|
options = {
|
|
stream: fs.createWriteStream(process.cwd() + '/' + config.log.options.stream, {flags: 'a'})
|
|
};
|
|
}
|
|
} catch (e) {
|
|
options = {};
|
|
}
|
|
|
|
return options;
|
|
}
|
|
|
|
}; |