Skip to content

Commit

Permalink
Merge pull request #1 from hidori/feature/add-coveredge
Browse files Browse the repository at this point in the history
 Add coverage via nyc
  • Loading branch information
hidori committed Mar 7, 2018
2 parents 0b75351 + baf534e commit 2eda7a3
Show file tree
Hide file tree
Showing 5 changed files with 2,211 additions and 148 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,6 @@ typings/
# dotenv environment variables file
.env

coverage/
.nyc_output/
.coveralls.yml
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
language: node_js
node_js:
- 8.9.4
- 8.10.0
notifications:
slack:
secure: BkcKpa/FAbqzHuLEbPxNAQ4sSCeMA0e/gtMJqxL2j1m6OwpadYN+S3a1xv7Xh0wZkA2mnXC1dYEzsZb+dFvHYICVv3Jz6Pi7ALmVnRhFHCYDAS5+hgaxwCt6x2Yr8+/0MPZF8R7A7hex98lA05V9nSuhslcVPfdjmgbPpIMcIRx7IryU5mfZtx/uKd0UtaMgpK326CJ6y/RYbhbTeYkXKmXYaygdBdUU8B24Z2y/x3N+75ZdUY2JfPEgpt9i1UDhVv9sNoWog3L5wSlxHjiTIvazl17/7eEUwTnyIwXiuJgaMqQBrSTcKssJJnvDZZoLnWQVwkmRUQ2uXVq19TR7TCQWUTZ41ABURt8PfouJV43emDSJmQKzPP0eENig7uORkODeHQIxCtnumt8flyLiUJ5Uohm1wiq0xwCaPCVz5wCCP+4v/drUuZ+iWq68PCUBdJyERkJxZZuYXGUC/iGX+qqOJYIdNgQswUFZbpkb9OW38t2fMc10YzYJsfEZIZ/EF3BI5/XHRASXssWatHtWFyHYFEdL3pAFfMpc7fNFyqB90Dj9YdLHRDc257sAl9iukjQ4jup3Kav/A+ssTHbgjQA1RePw8VmqjexRGc9iGuiTLQb64FS4gMLQy+0fGmVgr0pX0V5izrBqkV9yhn3AAEKpgFfb1c9GE13aAfttCgQ=
after_success: "./node_modules/.bin/nyc report --reporter=text-lcov | ./node_modules/.bin/coveralls"
env:
global:
secure: n0X7Sj6Hge2DDwNsjTx6jXN6BTP9CHnd2Cwi/2gRVSGG/zBH4vMqxAI0O2s7oWgG+fbzivLgxS5fmlUrd8rpMOEAqS22qmaFfRcUC/0hMLUIm2ZRCDEQMq9Dw5y75Yxt4bTbL5bm4fnCPRC7pwo3P+f9zZrB2yiRdnrA1zOUMGqaid91vOi6DZBfY41laqxYTGn8SiVa5McXgieOAnmbw42ylkKWL8o5k8/fzakzpNKAAvCfpVuX7p3DCxdSvHOm+GErd567gSl5JOnBDoq8MEFHdP3liQhq8zWmO/j6MfoBZQ+fqmIJmCJy1QHmdyoG3ZXgCrEM78ZTRqsvCsPccPv2P/fObBx3tupTiRAQl0dITOUDTypgwkhh7RwGDuujvalpJugGF0yJ2dTTLnzPZmitzaRMjsXtve2eNB2uXkVJUMad8S0kgOjwnyIflgHgO4MB04DlqCOJWyEw0QE+/2vcdf7QMukpsLb9yi0KrEV2UC7gH1yQzrv4DEErziC1Qi8KSpeHnA84Psh+yjjP0MrRu1lqunBzecUR0h0LEeVB8gBkDj9FRUnrLniCiRy9qN/0/EW2+uxdrTynqCoez6bBpEP7ph5jCDC8xyM2KjBtu4rV3PRhh6+8qq8fVGwTT/SNWs3m7UjU2rfH/VrOnctf2isxv+8fTuSYHrjrub8=
22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)
[![Build Status](https://travis-ci.org/rcmdnk/travis-test.svg?branch=master)](https://travis-ci.org/rcmdnk/travis-test)
[![Maintainability](https://api.codeclimate.com/v1/badges/1dd1bfe212c8d70c9b8b/maintainability)](https://codeclimate.com/github/hidori/node-json-logger/maintainability)
[![Build Status](https://travis-ci.org/rcmdnk/travis-test.svg?branch=master)](https://travis-ci.org/rcmdnk/travis-test)
[![Coverage Status](https://coveralls.io/repos/github/hidori/node-json-logger/badge.svg?branch=feature%2Fadd-coveredge)](https://coveralls.io/github/hidori/node-json-logger?branch=feature%2Fadd-coveredge)

node-json-logger
----
output logs as JSON to STDOUT

# Install
```sh
npm install -s node-json-logger
npm i node-json-logger
```
# Usage
```js
Expand All @@ -25,18 +26,19 @@ Output:
```

# API
## xxx
Output log. xxx is one of the [Levels](#Levels)
```
```js
logger.xxx(message, details)
```
Note:
* xxx is one of the [Levels](#Levels)

Arguments:
* message: Specify log message as string.
* details: Specify log details as object (optional).
* message: Specify a message as string.
* details: Specify details as object. (optional)

# Configuration
## level
Specify log output level (optional, default is `debug`).
Specify output level. (optional, default is `debug`)
```js
const Logger = require('node-json-logger');
const logger = new Logger({ level: 'error'});
Expand Down Expand Up @@ -64,7 +66,7 @@ Level and output:
| `{ level: 'fatal' }` | - | - | - | - | - | O |

## addendum
Spcify staic addeundum field. this is optional.
Spcify addeundum fields. (optional)
```js
const Logger = require('node-json-logger');
const logger = new Logger({
Expand All @@ -80,7 +82,7 @@ Output:
{"level":"info","source":"source.","message":"info."}
```

# <a href="#"></a>Levels
# <a href="#Levels"></a>Levels
* trace
* debug
* info
Expand Down

0 comments on commit 2eda7a3

Please sign in to comment.