node-zwave-js
offers its users the ability to replace the default winston log transports with custom implementations. This repository is the home for userland log transports.
- Copy the contents of
package-template
into a new folder underpackages
. That folder should have the same name as the transport, e.g.mysupercoolservice
. - Edit
package.json
of your new transport:- "name": "@zwave-js/log-transport-template", + "name": "@zwave-js/log-transport-mysupercoolservice", - "private": true, "version": "1.0.0-alpha.0", - "description": "Template log transport for Z-Wave JS", + "description": "My super cool log transport for Z-Wave JS",
- Register the new transport in
jest.config.js
:moduleNameMapper: { "^@zwave-js/log-transport-logfmt(.*)": "<rootDir>/packages/logfmt/src$1", + "^@zwave-js/log-transport-mysupercoolservice(.*)": "<rootDir>/packages/mysupercoolservice/src$1", },
- (optional) Add dependencies for your new transport module locally:
lerna add your-dependency --scope=@zwave-js/log-transport-mysupercoolservice
- (optional) Add type declarations for your new transport module in the root:
yarn add --dev -W @types/your-dependency