node-red-contrib-zwave-js
Version:
The most powerful, high performing and highly polished Z-Wave node for Node-RED based on Z-Wave JS. If you want a fully featured Z-Wave framework in your Node-RED instance, you have found it.
27 lines (21 loc) • 490 B
JavaScript
const WinstonTransport = require('winston-transport');
let _CallBack = undefined;
class Pin2LogTransport extends WinstonTransport {
constructor(options) {
_CallBack = options.callback;
delete options.callback;
super(options);
}
}
Pin2LogTransport.prototype.log = function (info, next) {
if (_CallBack !== undefined) {
_CallBack(info);
}
next();
};
Pin2LogTransport.close = function () {
_CallBack = undefined;
};
module.exports = {
Pin2LogTransport: Pin2LogTransport
};