Comparing version 0.20.0 to 0.21.0
{ | ||
"name": "anylogger", | ||
"version": "0.20.0", | ||
"version": "0.21.0", | ||
"description": "Get a logger. Any logger.", | ||
@@ -5,0 +5,0 @@ "main": "anylogger.js", |
@@ -1,2 +0,2 @@ | ||
# anylogger <sub><sup>0.20.0</sup></sub> | ||
# anylogger <sub><sup>0.21.0</sup></sub> | ||
### Get a logger. Any logger. | ||
@@ -8,3 +8,2 @@ | ||
[![greenkeeper](https://img.shields.io/david/Download/anylogger.svg)](https://greenkeeper.io/) | ||
[![Greenkeeper badge](https://badges.greenkeeper.io/Download/anylogger.svg)](https://greenkeeper.io/) | ||
![mind BLOWN](https://img.shields.io/badge/mind-BLOWN-ff69b4.svg) | ||
@@ -69,5 +68,5 @@ | ||
* [anylogger.js](https://unpkg.com/anylogger@0.20.0/anylogger.js) | ||
* [anylogger.js](https://unpkg.com/anylogger@0.21.0/anylogger.js) | ||
(fully commented source ~5kB) | ||
* [anylogger.min.js](https://unpkg.com/anylogger@0.20.0/anylogger.min.js) | ||
* [anylogger.min.js](https://unpkg.com/anylogger@0.21.0/anylogger.min.js) | ||
(minified 615 bytes, gzipped ~[386](#gzip-size) bytes) | ||
@@ -80,3 +79,3 @@ | ||
```html | ||
<script src="https://unpkg.com/anylogger@0.20.0/anylogger.min.js"></script> | ||
<script src="https://unpkg.com/anylogger@0.21.0/anylogger.min.js"></script> | ||
<script>(function(){ // IIFE | ||
@@ -109,3 +108,3 @@ var log = anylogger('index.html') | ||
"peerDependencies": { | ||
"anylogger": ">=0.20.0" | ||
"anylogger": ">=0.21.0" | ||
} | ||
@@ -392,3 +391,3 @@ } | ||
Uses some evil eval trickery to create a named function so that function.name | ||
Uses `new Function(..)` to create a named function so that function.name | ||
corresponds to the module name given. Polyfills function.name on platforms | ||
@@ -403,2 +402,7 @@ where it is not natively available. | ||
If the logging framework you are writing an adapter for uses a config | ||
object, you should override `anylogger.new` and do something useful with | ||
the config object here (set it as a property on the logger for example), | ||
because the default implementation just ignores it. | ||
Instead of completely trying to replace the original method, I recommend you | ||
@@ -417,4 +421,4 @@ chain it to include your one-time customizations like this: | ||
var logger = make(name, config) | ||
// add your customizations | ||
logger.myCoolFeature = function(){logger.info('My cool feature!')} | ||
// do something useful with the config object | ||
logger.config = config | ||
// return the customized logger | ||
@@ -425,2 +429,4 @@ return logger | ||
> All anylogger methods are independent of `this` so they can all be easily chained | ||
If you need to re-apply customizations any time relevant config changes (such | ||
@@ -468,3 +474,3 @@ as active log level changing), override `anylogger.ext`. | ||
Please have a look at the | ||
[source](https://unpkg.com/anylogger@0.20.0/anylogger.js) | ||
[source](https://unpkg.com/anylogger@0.21.0/anylogger.js) | ||
it should make it more clear how to write an adapter. Also consider studying | ||
@@ -486,2 +492,4 @@ the [available adapters](https://www.npmjs.com/search?q=keywords:anylogger) | ||
* [Jakub Jirutka](https://github.com/jirutka) who [contributed](https://github.com/Download/anylogger/pull/2) TypeScript type declarations. | ||
* [TJ Holowaychuk](https://github.com/tj) for writing [debug](https://npmjs.com/package/debug) | ||
* [Tim Perry](https://github.com/pimterry) for writing [loglevel](https://npmjs.com/package/loglevel) | ||
@@ -498,3 +506,3 @@ | ||
© 2019 by [Stijn de Witt](https://stijndewitt.com). Some rights reserved. | ||
© 2020 by [Stijn de Witt](https://stijndewitt.com). Some rights reserved. | ||
Contributions by [Jakub Jirutka](https://github.com/jirutka). | ||
@@ -501,0 +509,0 @@ |
32970
509