HackMD/lib
Sheogorath bdeb053397
Fix streaming for winston
During the upgrade of winston in
c3584770f2 a the class extension for
streaming was removed.

This caused silent crashes. Somehow winston simply called
`process.exit(1)` whenever `logger.write()` was called. This is really
bad and only easy to debug because of the testing right after upgrading.

However, reimplementing the stream interface as it was, didn't work, due
to the fact that `logger.write()` is already implemented and causes the
mentioned problem. So we extent the object with an `stream` object that
implements `write()` for streams and pass that to morgan.

So this patch fixes unexpected exiting for streaming towards our logging
module.

References:
https://www.digitalocean.com/community/tutorials/how-to-use-winston-to-log-node-js-applications
c3584770f2
https://stackoverflow.com/a/28824464
Signed-off-by: Sheogorath <sheogorath@shivering-isles.com>
2018-11-16 11:49:39 +01:00
..
config Upgrade winston 2018-11-14 00:47:11 +01:00
migrations Extend migration error handling 2018-09-05 16:19:35 +01:00
models switching to eslint for code checking 2018-11-14 23:15:36 +01:00
ot Fix logging in ot module 2018-11-13 23:30:13 +01:00
web Merge pull request #1058 from ccoenen/bug/oauth2internalerror 2018-11-16 11:45:50 +01:00
workers refactor: Remove require extension filename 2017-05-08 19:29:06 +08:00
csp.js Add data: URL to CSP and upgrade helmet 2018-10-04 03:04:36 +02:00
history.js Further improvement of error handling for LZString 2018-07-27 15:42:58 +02:00
letter-avatars.js Fix possible weird objects as email 2018-07-27 13:36:22 +02:00
logger.js Fix streaming for winston 2018-11-16 11:49:39 +01:00
realtime.js switching to eslint for code checking 2018-11-14 23:15:36 +01:00
response.js Merge pull request #1027 from asg017/master 2018-11-12 22:11:44 +01:00
utils.js switch to __dirname 2017-06-02 11:34:35 +01:00