Log and capture events on Rollbar from the redux-actions
Redux Rollbar Log Middleware
Middleware that helps log and captureEvent to Rollbar from the redux actions
Note: lib/
is in repo until we publish package on npm
Requirements
We've tested it on Rollbar.js v2.2.8, but it can work with any Rollbar.js version, that contains the Telemetry.
Installation
npm install redux-rollbar-log-middleware --save # or yarn install redux-rollbar-log-middleware --save
Usage
-- -------------------- ---- ------- ------ - ------------ --------------- - ---- ------- ------ -------------------- ---- ------------------------------ ------ ------- ---- --------- -- ------ ------ --- ------ --- --- ----------- --------------------------------------------------------------------------------- ----- ------- - --- --------- -- --- ---- ------ -- -- ----- ---------- - - ----------------------------- -- ------ ----- ----- - ------------ ------------ -------------------- ------------------------------- - -
createLogAction
-- -------------------- ---- ------- ------ - --------------- - ---- ------------------------------ ------ ----- ----------- - -- -- -------- -- - -------------------------- ----- -------- -------- ----- --- -------- ----- - ------- ---- - --- -
Action properties
Name | Type | Default | Description |
---|---|---|---|
type | string |
debug |
Rollbar log type. "critical", "error", "warning", "info" or "debug" |
message | string |
- | Log message |
body | object |
- | Log body |
captureEvent
-- -------------------- ---- ------- ------ - ------------------- - ---- ------------------------------ ------ ----- ----------- - -- -- -------- -- - ------------------------------ ----- -------- ----- - ------- ---- - --- -
Action properties
Name | Type | Default | Description |
---|---|---|---|
type | string |
debug |
Rollbar capture event type. "critical", "error", "warning", "info" or "debug" |
body | object |
- | Capture event body |
You can find more usecases in the tests.
License
MIT
HomePage
https://github.com/Syft-Application/redux-rollbar-log-middleware#readme
Repository
git+https://github.com/Syft-Application/redux-rollbar-log-middleware.git
来源:JavaScript中文网 ,转载请注明来源 https://www.javascriptcn.com/post/600562ac81e8991b448dfea2