Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
logan fisher authored and logan fisher committed Sep 6, 2018
0 parents commit a6d8d9f
Show file tree
Hide file tree
Showing 10 changed files with 11,646 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"sourceMaps": "inline",
"plugins": [
"transform-es2015-modules-commonjs",
"transform-strict-mode",
"transform-es2015-destructuring",
"transform-es2015-parameters",
"transform-es2015-arrow-functions",
[
"transform-object-rest-spread",
{
"useBuiltIns": true
}
]
]
}
6 changes: 6 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "parkhub-base",
"env": {
"jest/globals": true
}
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
## Yodelay

Yodelay was made to combine the ability of logging and alerting to slack. The Winston logger adds a transport for uncaught exceptions so that we can notify slack with the error as it happens in the code. I also would like to extend the ability to alert for other cases possibly but for now this will do.

### Example

```
import Yodelay from "yodelay";
const logger = new Yodelay({
slackUrl: process.env.SLACK_URL,
level: process.env.LOG_LEVEL,
format: process.env.LOG_FORMAT,
channel: "#exceptions"
}).initialize();
logger.info('This is an info log...');
logger.error('This is an info log...');
logger.debug('This is an info log...');
```

| Param | Description | Type | Required | Options | Default |
| -------- | --------------------- | ------ | -------- | ------------------------ | ------- |
| slackUrl | Webhook url for Slack | String | true | | |
| level | Log level | String | true | (inherited from winston) | info |
| format | Log format | String | true | simple, json | simple |
| channel | Slack channel | String | true | | |
67 changes: 67 additions & 0 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 44 additions & 0 deletions dist/transports/uncaught_exception.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a6d8d9f

Please sign in to comment.