added unit testing, and started implementing unit tests...phew

This commit is contained in:
Josh Burman
2019-03-12 22:28:02 -04:00
parent 74aad4a957
commit e8c2539f1b
3489 changed files with 464813 additions and 88 deletions

31
dist/server/logger.js vendored Normal file
View File

@ -0,0 +1,31 @@
"use strict";
var { winston, transports, createLogger, format } = require('winston');
var path = require('path');
// Set this to whatever, by default the path of the script.
var logPath = './logs/';
const tsFormat = () => (new Date().toISOString());
const errorLog = createLogger({
format: format.combine(format.timestamp(), format.json()),
transports: [
new transports.File({
filename: path.join(logPath, 'errors.log'),
timestamp: tsFormat,
level: 'debug'
})
]
});
const accessLog = createLogger({
format: format.combine(format.timestamp(), format.json()),
transports: [
new transports.File({
filename: path.join(logPath, 'access.log'),
timestamp: tsFormat,
level: 'info'
})
]
});
module.exports = {
errorLog: errorLog,
accessLog: accessLog
};
//# sourceMappingURL=logger.js.map