bunyan-winston-adapter
Advanced tools
Comparing version 0.1.0 to 0.2.0
@@ -44,6 +44,13 @@ 'use strict'; | ||
createAdapter: function(winston) { | ||
createAdapter: function(winston, mapping) { | ||
var obj = Object.create(this, { | ||
_winston: {value: winston} | ||
}); | ||
if (typeof mapping === 'object') { | ||
for (var key in mapping) { | ||
obj[key] = _log(mapping[key]); | ||
} | ||
} | ||
return obj; | ||
@@ -50,0 +57,0 @@ } |
{ | ||
"name": "bunyan-winston-adapter", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "Allows to use winston logger in restify server without really using bunyan.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -22,2 +22,14 @@ bunyan-winston-adapter | ||
It is also possible to provide your own mapping from bunyan to winston. This will override default mapping. You can provide only the types you want to override: | ||
``` | ||
var mapping = { | ||
trace: 'silly' | ||
}; | ||
restify.createServer({ | ||
log: bunyanToWinstonAdapter.createAdapter(winston, mapping), | ||
}); | ||
``` | ||
## Why not add a logger to bunyan that pushes to winston? | ||
@@ -24,0 +36,0 @@ |
4477
50
42