residue-winston
Advanced tools
Comparing version 1.0.7 to 1.0.8
19
index.js
@@ -16,7 +16,7 @@ // | ||
const util = require('util'); | ||
const residue = require('residue'); | ||
const residue_internal = require('residue'); | ||
const winston = require('winston') | ||
const TransportStream = require('winston-transport'); | ||
const Residue = module.exports = function(options) { | ||
const Residue = function(options) { | ||
if (!options) { | ||
@@ -31,9 +31,8 @@ throw "Please provide residue-node options"; | ||
if (options.config_file) { | ||
residue.loadConfiguration(options.config_file); | ||
residue_internal.loadConfiguration(options.config_file); | ||
} else { | ||
residue.loadConfiguration(options); | ||
residue_internal.loadConfiguration(options); | ||
} | ||
residue.connect(); | ||
this._residue = residue; // for export purposes | ||
this.logger = residue.getLogger(options.logger_id); | ||
residue_internal.connect(); | ||
this.logger = residue_internal.getLogger(options.logger_id); | ||
}; | ||
@@ -52,3 +51,3 @@ | ||
Residue.prototype.log = function(arg1, arg2) { | ||
const level = typeof arg1 === 'string' ? arg1 : arg1.level; | ||
@@ -81,3 +80,3 @@ const msg = typeof arg2 === 'string' ? arg2 : arg1.message; | ||
} | ||
this.emit('logged'); | ||
@@ -90,1 +89,3 @@ | ||
module.exports.residue = Residue; | ||
module.exports.residue_internal = residue_internal; |
{ | ||
"name": "residue-winston", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "Winston transport for Residue", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -14,3 +14,6 @@ ﷽ | ||
```javascript | ||
const Residue = require('residue-winston'); | ||
const residue = require('residue-winston'); | ||
// or import residue from 'residue-winston'; | ||
// you can import internal residue-node library as | ||
// import { residue_internal } from 'residue-winston'; | ||
const logger = winston.createLogger({ | ||
@@ -27,2 +30,4 @@ level: 'silly', | ||
}); | ||
console.log(`Residue library version ${residue_internal.version()}-${residue_internal.type()}`); | ||
``` | ||
@@ -29,0 +34,0 @@ |
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
5367
73
54