1.0.6 - Discord integration, logging, bugfixes
This commit is contained in:
parent
863c1aff40
commit
83860ff052
23 changed files with 1648 additions and 129 deletions
23
app/src/winston.js
Normal file
23
app/src/winston.js
Normal 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;
|
||||
Loading…
Add table
Add a link
Reference in a new issue