Comparing version 0.0.3 to 0.0.4
@@ -444,3 +444,3 @@ "use strict"; | ||
Logger.version = '0.0.3'; | ||
Logger.version = '0.0.4'; | ||
@@ -447,0 +447,0 @@ /** |
{ | ||
"name": "devnull" | ||
, "version": "0.0.3" | ||
, "version": "0.0.4" | ||
, "description": "A simple logger with automatic function detection." | ||
@@ -14,6 +14,7 @@ , "homepage": "http://observer.no.de" | ||
"colors": "0.5.1" | ||
, "mongodb": "" | ||
} | ||
, "devDependencies": { | ||
"mocha": "*" | ||
, "should": "0.3.2" | ||
, "should": "*" | ||
, "long-stack-traces": "0.1.2" | ||
@@ -20,0 +21,0 @@ } |
@@ -21,3 +21,5 @@ /**! | ||
fixtures = {}; | ||
fixtures = { | ||
mongodb: 'mongodb://test:test@localhost:27017/myapp' | ||
}; | ||
@@ -24,0 +26,0 @@ /** |
@@ -49,5 +49,3 @@ "use strict"; | ||
Streamer.prototype.write = function write (type, namespace, args) { | ||
if (this.stream.writable) { | ||
this.stream.write( | ||
this.logger.stamp() | ||
var log = this.logger.stamp() | ||
+ ' ' | ||
@@ -59,4 +57,9 @@ + this.logger.prefix[type] | ||
+ this.logger.format.apply(this, args) | ||
+ '\n' | ||
); | ||
+ '\n'; | ||
if (this.stream.writable) { | ||
this.stream.write(log); | ||
this.logger.emit('transport:write', log); | ||
} else { | ||
this.logger.emit('transport:error', new Error('stream not writable'), log); | ||
} | ||
@@ -67,2 +70,8 @@ | ||
/** | ||
* Shutdown down the transport. | ||
* | ||
* @api private | ||
*/ | ||
Streamer.prototype.close = function () { | ||
@@ -69,0 +78,0 @@ // don't close the stdout |
@@ -25,2 +25,5 @@ var EventEmitter = process.EventEmitter; | ||
var Transport = module.exports = function transport (logger, options) { | ||
var self = this | ||
, key; | ||
options = options || {}; | ||
@@ -31,3 +34,3 @@ this.name = 'transport'; | ||
// exact same type | ||
for (var key in options) { | ||
for (key in options) { | ||
if (key in this | ||
@@ -44,4 +47,7 @@ && type(this[key]) !== 'function' | ||
// lazy initialize | ||
if (this.initialize) { | ||
this.initialize.call(this, options); | ||
process.nextTick(function next () { | ||
self.initialize.call(self, options); | ||
}); | ||
} | ||
@@ -48,0 +54,0 @@ }; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Wildcard dependency
QualityPackage has a dependency with a floating version range. This can cause issues if the dependency publishes a new major version.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
48655
17
1345
161
1
2
2
+ Addedmongodb@
+ Added@mongodb-js/saslprep@1.2.0(transitive)
+ Added@types/webidl-conversions@7.0.3(transitive)
+ Added@types/whatwg-url@11.0.5(transitive)
+ Addedbson@6.10.3(transitive)
+ Addedmemory-pager@1.5.0(transitive)
+ Addedmongodb@6.13.0(transitive)
+ Addedmongodb-connection-string-url@3.0.2(transitive)
+ Addedpunycode@2.3.1(transitive)
+ Addedsparse-bitfield@3.0.3(transitive)
+ Addedtr46@5.0.0(transitive)
+ Addedwebidl-conversions@7.0.0(transitive)
+ Addedwhatwg-url@14.1.1(transitive)