Skip to content

Commit 3de89dd

Browse files
committed
Merge branch 'release/1.0.0'
2 parents 85b97aa + 88684e5 commit 3de89dd

File tree

12 files changed

+3135
-2
lines changed

12 files changed

+3135
-2
lines changed

.eslintignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/bin/**
2+
/build/**
3+
/coverage/**
4+
/docs/**
5+
/jsdoc/**
6+
/templates/**
7+
/tests/bench/**
8+
/tests/fixtures/**
9+
/tests/performance/**
10+
/tmp/**
11+
/public/**
12+
/node_modules/**
13+
/lib-cov/**
14+
/.grunt/**
15+
/.sonar/**
16+
/logs/**
17+
/.idea/**

.eslintrc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"extends": "airbnb",
3+
"env": {
4+
"node":true,
5+
"mocha":true,
6+
"es6": true,
7+
"mongo":true
8+
},
9+
"rules": {
10+
// disable requiring trailing commas
11+
"comma-dangle": 0,
12+
"max-len": ["error", {"code": 120, "ignoreComments": true, "ignoreUrls": true}],
13+
"no-restricted-syntax": 0,
14+
"class-methods-use-this": 0
15+
}
16+
}

.gitignore

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/examples
2+
.DS_STORE
3+
4+
# Logs
5+
logs
6+
*.log
7+
npm-debug.log*
8+
9+
# Runtime data
10+
pids
11+
*.pid
12+
*.seed
13+
14+
# Directory for instrumented libs generated by jscoverage/JSCover
15+
lib-cov
16+
17+
# Coverage directory used by tools like istanbul
18+
coverage
19+
20+
# nyc test coverage
21+
.nyc_output
22+
23+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
24+
.grunt
25+
26+
# node-waf configuration
27+
.lock-wscript
28+
29+
# Compiled binary addons (http://nodejs.org/api/addons.html)
30+
build/Release
31+
32+
# Dependency directories
33+
node_modules
34+
jspm_packages
35+
36+
# Optional npm cache directory
37+
.npm
38+
39+
# Optional REPL history
40+
.node_repl_history

.npmignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.git
2+
.DS_STORE
3+
node_modules
4+
coverage
5+
test
6+
.sonar
7+
.gitignore
8+
.eslintignore
9+
.eslintrc
10+
.npmignore
11+
Makefile
12+
sonar-project.properties

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2017 Dial Once
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Makefile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
.PHONY: test
2+
3+
deps:
4+
npm i
5+
6+
lint:
7+
node_modules/.bin/eslint .
8+
9+
test:
10+
make lint
11+
make cover
12+
13+
cover:
14+
node_modules/.bin/istanbul cover node_modules/.bin/_mocha -- test --recursive --timeout=10000
15+
16+
sonar:
17+
sed '/sonar.projectVersion/d' ./sonar-project.properties > tmp && mv tmp sonar-project.properties
18+
echo sonar.projectVersion=`cat package.json | python -c "import json,sys;obj=json.load(sys.stdin);print obj['version'];"` >> sonar-project.properties
19+
wget https://sonarsource.bintray.com/Distribution/sonar-scanner-cli/sonar-scanner-2.8.zip
20+
unzip sonar-scanner-2.8.zip
21+
ifdef CI_PULL_REQUEST
22+
@sonar-scanner-2.8/bin/sonar-runner -e -Dsonar.analysis.mode=preview -Dsonar.github.pullRequest=${shell basename $(CI_PULL_REQUEST)} -Dsonar.github.repository=$(REPO_SLUG) -Dsonar.github.oauth=$(GITHUB_TOKEN) -Dsonar.login=$(SONAR_LOGIN) -Dsonar.password=$(SONAR_PASS) -Dsonar.host.url=$(SONAR_HOST_URL)
23+
endif
24+
ifeq ($(CIRCLE_BRANCH),develop)
25+
@sonar-scanner-2.8/bin/sonar-runner -e -Dsonar.analysis.mode=publish -Dsonar.host.url=$(SONAR_HOST_URL) -Dsonar.login=$(SONAR_LOGIN) -Dsonar.password=$(SONAR_PASS)
26+
endif
27+
rm -rf sonar-scanner-2.8 sonar-scanner-2.8.zip

README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# logtify-logentries
2+
[![CircleCI](https://circleci.com/gh/dial-once/node-logtify-logentries.svg?style=svg)](https://circleci.com/gh/dial-once/node-logtify-logentries)
3+
4+
Logentries subscriber for [logtify](https://github.com/dial-once/node-logtify) logger
5+
6+
## Installation
7+
```
8+
npm i -S logtify-logentries
9+
```
10+
11+
## Usage
12+
Used with [logtify](https://github.com/dial-once/node-logtify) module.
13+
14+
```js
15+
require('logtify-logentries')({ LOGS_TOKEN: 'YOUR_LOGENTRIES_TOKEN' });
16+
const { stream, logger } = require('logtify')();
17+
18+
logger.log('error', new Error('Test error'));
19+
logger.info('Hello world!');
20+
```
21+
The subscriber will make sure that a message will be sent to Logentries if:
22+
* ``message.level >= 'MIN_LOG_LEVEL_LOGENTRIES' || 'MIN_LOG_LEVEL'``
23+
* ``process.env.LOGENTRIES_LOGGING !== 'false' || settings.LOGENTRIES_LOGGING !== false``
24+
25+
## Configuration
26+
**Environment variables**:
27+
* ``process.env.LOGENTRIES_LOGGING = 'true|false'`` - Switching on / off the subscriber. On by default
28+
* ``process.env.LOGS_TOKEN = 'TOKEN'`` - your Logentries token
29+
* ``process.env.MIN_LOG_LEVEL_LOGENTRIES = 'silly|verbose|info|warn|error'``
30+
31+
**Settings**:
32+
```js
33+
{
34+
LOGENTRIES_LOGGING: true|false,
35+
LOGS_TOKEN: 'YOUR_LOGENTRIES_TOKEN',
36+
MIN_LOG_LEVEL_LOGENTRIES: 'silly|verbose|info|warn|error'
37+
}
38+
```

0 commit comments

Comments
 (0)