1.0.6 - Discord integration, logging, bugfixes

This commit is contained in:
exttex 2020-09-28 12:04:19 +02:00
parent 863c1aff40
commit 83860ff052
23 changed files with 1648 additions and 129 deletions

23
app/src/winston.js Normal file
View file

@ -0,0 +1,23 @@
const winston = require('winston');
const path = require('path');
const {Settings} = require('./settings');
const { Transform } = require('stream');
const logger = winston.createLogger({
level: 'info',
format: winston.format.simple(),
transports: [
new winston.transports.Console(),
new winston.transports.File({filename: path.join(Settings.getDir(), "freezer-server.log")}),
]
});
//Node errors
process.on('uncaughtException', (err) => {
logger.error('Unhandled Exception: ' + err + "\nStack: " + err.stack);
});
process.on('unhandledRejection', (err) => {
logger.error('Unhandled Rejection: ' + err + "\nStack: " + err.stack);
})
module.exports = logger;