-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlogger.js
More file actions
28 lines (23 loc) · 669 Bytes
/
logger.js
File metadata and controls
28 lines (23 loc) · 669 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
var winston = require('winston');
var path = require('path');
// Set this to whatever, by default the path of the script.
var logPath = __dirname;
function createLogger(){
return winston.createLogger({
transports: [
new winston.transports.File({
filename: path.join(logPath, 'filterhits.log'),
level: 'info'
})
]
});
}
let filterHitsLog = createLogger();
const setLogPath = (newLogPath) => {
logPath = newLogPath;
module.exports.filterHitsLog = createLogger();
}
module.exports = {
filterHitsLog: filterHitsLog,
setLogPath: setLogPath
};