Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

debug-logtron

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

debug-logtron - npm Package Compare versions

Comparing version 2.1.0 to 2.1.1

17

backends/debug-log-backend.js
'use strict';
var Writable = require('readable-stream/writable');
var globalDebuglog = require('debuglog');
var inspect = require('util/').inspect;
var inspect = require('util').inspect;

@@ -24,11 +23,10 @@ module.exports = DebugLogBackend;

var self = this;
var stream = new Writable({
objectMode: true
});
stream._write = write;
var stream = {
write: write
};
return stream;
function write(logRecord, enc, cb) {
function write(logRecord, cb) {
var msg = logRecord.levelName + ': ' +

@@ -39,4 +37,7 @@ logRecord.fields.msg + ' ~ ' +

self.log(msg);
cb();
if (cb) {
cb();
}
}
};
'use strict';
var assert = require('assert/');
var assert = require('assert');
var process = require('process/');
var os = require('os');
var Buffer = require('buffer').Buffer;
var CircularJSON = require('circular-json');
var extend = require('xtend');

@@ -48,3 +47,3 @@

var jsonStr = CircularJSON.stringify(logRecord.fields);
var jsonStr = JSON.stringify(logRecord.fields);
this._buffer = new Buffer(jsonStr);

@@ -51,0 +50,0 @@ }

{
"name": "debug-logtron",
"version": "2.1.0",
"version": "2.1.1",
"description": "A debug logger with a logtron interface.",

@@ -20,9 +20,5 @@ "keywords": [],

"dependencies": {
"assert": "^1.3.0",
"circular-json": "^0.1.6",
"debuglog": "^1.0.1",
"error": "^5.0.0",
"process": "^0.10.0",
"readable-stream": "^1.0.33",
"util": "^0.10.3",
"xtend": "^4.0.0"

@@ -33,3 +29,3 @@ },

"istanbul": "^0.3.5",
"lint-trap": "^1.0.0",
"lint-trap": "1.0.1",
"opn": "^1.0.1",

@@ -36,0 +32,0 @@ "pre-commit": "0.0.11",

@@ -30,2 +30,19 @@ 'use strict';

test('can log async', function t(assert) {
var logger = allocLogger();
logger.debug('oh hi', {}, onLogged);
function onLogged(err) {
assert.ifError(err);
assert.equal(logger.lines.length, 1);
var line = logger.lines[0];
assert.equal(line.namespace, 'debuglogtron');
assert.equal(line.msg, 'debug: oh hi ~ {}');
assert.end();
}
});
test('logger throws with bad namespace', function t(assert) {

@@ -32,0 +49,0 @@ assert.throws(function throwIt() {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc