loglevel-mixin
Advanced tools
Comparing version 5.0.0 to 5.0.1
{ | ||
"name": "loglevel-mixin", | ||
"version": "5.0.0", | ||
"type": "module", | ||
"version": "5.0.1", | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"sideEffects": false, | ||
"type": "module", | ||
"main": "src/loglevel-mixin.mjs", | ||
@@ -26,3 +27,2 @@ "module": "src/loglevel-mixin.mjs", | ||
"lint": "documentation lint src/loglevel-mixin.mjs", | ||
"posttest": "markdown-doctest", | ||
"test": "ava" | ||
@@ -34,9 +34,8 @@ }, | ||
"c8": "^6.0.1", | ||
"documentation": "^12.1.2", | ||
"documentation": "^12.1.4", | ||
"esm": "^3.2.25", | ||
"markdown-doctest": "^1.0.0", | ||
"semantic-release": "^15.13.28" | ||
"semantic-release": "^15.13.31" | ||
}, | ||
"engines": { | ||
"node": ">=12.12.0" | ||
"node": ">=12.13.1" | ||
}, | ||
@@ -43,0 +42,0 @@ "repository": { |
@@ -0,14 +1,13 @@ | ||
[![Build Status](https://secure.travis-ci.org/arlac77/loglevel-mixin.png)](http://travis-ci.org/arlac77/loglevel-mixin) | ||
[![codecov.io](http://codecov.io/github/arlac77/loglevel-mixin/coverage.svg?branch=master)](http://codecov.io/github/arlac77/loglevel-mixin?branch=master) | ||
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/) | ||
[![downloads](http://img.shields.io/npm/dm/loglevel-mixin.svg?style=flat-square)](https://npmjs.org/package/loglevel-mixin) | ||
[![GitHub Issues](https://img.shields.io/github/issues/arlac77/loglevel-mixin.svg?style=flat-square)](https://github.com/arlac77/loglevel-mixin/issues) | ||
[![Greenkeeper](https://badges.greenkeeper.io/arlac77/loglevel-mixin.svg)](https://greenkeeper.io/) | ||
[![Known Vulnerabilities](https://snyk.io/test/github/arlac77/loglevel-mixin/badge.svg)](https://snyk.io/test/github/arlac77/loglevel-mixin) | ||
[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause) | ||
[![minified size](https://badgen.net/bundlephobia/min/loglevel-mixin)](https://bundlephobia.com/result?p=loglevel-mixin) | ||
[![npm](https://img.shields.io/npm/v/loglevel-mixin.svg)](https://www.npmjs.com/package/loglevel-mixin) | ||
[![Greenkeeper](https://badges.greenkeeper.io/arlac77/loglevel-mixin.svg)](https://greenkeeper.io/) | ||
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/arlac77/loglevel-mixin) | ||
[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier) | ||
[![Build Status](https://secure.travis-ci.org/arlac77/loglevel-mixin.png)](http://travis-ci.org/arlac77/loglevel-mixin) | ||
[![codecov.io](http://codecov.io/github/arlac77/loglevel-mixin/coverage.svg?branch=master)](http://codecov.io/github/arlac77/loglevel-mixin?branch=master) | ||
[![Known Vulnerabilities](https://snyk.io/test/github/arlac77/loglevel-mixin/badge.svg)](https://snyk.io/test/github/arlac77/loglevel-mixin) | ||
[![GitHub Issues](https://img.shields.io/github/issues/arlac77/loglevel-mixin.svg?style=flat-square)](https://github.com/arlac77/loglevel-mixin/issues) | ||
[![Dependency Status](https://david-dm.org/arlac77/loglevel-mixin.svg)](https://david-dm.org/arlac77/loglevel-mixin) | ||
[![devDependency Status](https://david-dm.org/arlac77/loglevel-mixin/dev-status.svg)](https://david-dm.org/arlac77/loglevel-mixin#info=devDependencies) | ||
[![docs](http://inch-ci.org/github/arlac77/loglevel-mixin.svg?branch=master)](http://inch-ci.org/github/arlac77/loglevel-mixin) | ||
[![downloads](http://img.shields.io/npm/dm/loglevel-mixin.svg?style=flat-square)](https://npmjs.org/package/loglevel-mixin) | ||
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/) | ||
@@ -20,2 +19,3 @@ # loglevel-mixin | ||
So the model object itself can be used as a logger and the log level is directly attaches to the model | ||
# usage | ||
@@ -29,4 +29,4 @@ | ||
let someObject = { | ||
log(level, message) { | ||
console.log(`${level} ${message}`); | ||
log(severity, message) { | ||
console.log(`${severity} ${message}`); | ||
} | ||
@@ -40,7 +40,7 @@ }; | ||
someObject.info( | ||
level => 'my info message (not reported since logLevel is error)' | ||
severity => 'my info message (not reported since logLevel is error)' | ||
); | ||
someObject.logLevel = 'info'; | ||
someObject.info( | ||
level => 'my info message (reported since logLevel is now info)' | ||
severity => 'my info message (reported since logLevel is now info)' | ||
); | ||
@@ -68,7 +68,7 @@ ``` | ||
someObject.info( | ||
level => 'my info message (not reported since logLevel is error)' | ||
severity => 'my info message (not reported since logLevel is error)' | ||
); | ||
someObject.logLevel = 'info'; | ||
someObject.info( | ||
level => 'my info message (reported since logLevel is now info)' | ||
severity => 'my info message (reported since logLevel is now info)' | ||
); | ||
@@ -225,3 +225,3 @@ ``` | ||
- `level` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** log level | ||
- `severity` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** log severity | ||
- `arg` **([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object))** original log message - level may be overwritten | ||
@@ -228,0 +228,0 @@ - `args` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** additional values to be merged into the final log event - values have precedence |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5
18158
216