I'm having a hard time trying to get a winstom custom logger compiled using typescript.
I'm taking this js code as starting point and taking into account this comment from github:
import * as Transport from 'winston-transport'
//
// Inherit from `winston-transport` so you can take advantage
// of the base functionality and `.exceptions.handle()`.
//
module.exports = class YourCustomTransport extends Transport {
constructor(opts) {
super(opts);
//
// Consume any custom options here. e.g.:
// - Connection information for databases
// - Authentication information for APIs (e.g. loggly, papertrail,
// logentries, etc.).
//
}
log(info, callback) {
setImmediate(() => {
this.emit('logged', info);
});
// Perform the writing to the remote service
callback();
}
};
But I get the error:
Type 'typeof TransportStream' is not a constructor function type.ts(2507)
I tried with several alternatives but always end up blocked by typescript compiler.