Skip to content
This repository was archived by the owner on Aug 30, 2021. It is now read-only.

Commit d2d4e8c

Browse files
committed
realized I forgot to add the actual logger
1 parent bf7bcc6 commit d2d4e8c

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

config/logger.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
'use strict';
2+
3+
/**
4+
* Module dependencies.
5+
*/
6+
7+
var morgan = require('morgan');
8+
var config = require('./config');
9+
var fs = require('fs');
10+
11+
/**
12+
* Module init function.
13+
*/
14+
module.exports = {
15+
16+
getLogFormat: function() {
17+
return config.log.format;
18+
},
19+
20+
getLogOptions: function() {
21+
var options = {};
22+
23+
if ('stream' in config.log.options) {
24+
options = {
25+
stream: fs.createWriteStream(process.cwd() + '/' + config.log.options.stream, {flags: 'a'})
26+
};
27+
}
28+
29+
return options;
30+
}
31+
32+
};

0 commit comments

Comments
 (0)