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

tracer

Package Overview
Dependencies
Maintainers
1
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tracer - npm Package Compare versions

Comparing version 0.9.8 to 0.9.9

2

example/console.js
"use strict";
var logger = require('..').console();
var logger = require('tracer').console();
logger.log('hello');

@@ -4,0 +4,0 @@ logger.trace('hello', 'world');

@@ -9,3 +9,3 @@ {

},
"version": "0.9.8",
"version": "0.9.9",
"author": "LI Long <lilong@gmail.com>",

@@ -17,2 +17,3 @@ "license": "MIT",

"mkdirp": "^0.5.1",
"nyc": "^14.1.1",
"tinytim": "0.1.1"

@@ -22,9 +23,8 @@ },

"cli-color": "^1.4.0",
"dtslint": "^0.4.2",
"eslint": "^5.11.1",
"expresso": "^0.9.2",
"istanbul": "^0.4.5",
"dtslint": "^0.4.9",
"eslint": "^5.16.0",
"mocha": "^6.2.0",
"mongoskin": "2.1.0",
"tslint": "^5.12.0",
"typescript": "^3.2.2"
"tslint": "^5.18.0",
"typescript": "^3.5.3"
},

@@ -40,7 +40,7 @@ "main": "./lib/index",

"scripts": {
"test": "expresso test/*",
"test": "mocha test/*",
"lint:fix": "eslint --fix .",
"lint": "eslint .",
"posttest": "npm run lint",
"test:coverage": "istanbul cover expresso test/*.js",
"test:coverage": "nyc npm run test",
"posttest:coverage": "npm run lint",

@@ -47,0 +47,0 @@ "dtslint": "dtslint types"

@@ -492,2 +492,7 @@ # tracer for node.js

### 0.9.9
* Fixed. Port tests from expresso to mocha. Fixes #105 #106 by @ossdev07.
* Fixed. Update type definitions to be able to use array in filters. #104 by @irisked.
* Fixed potential security vulnerabilities in your dependencies in istanbul package.
### 0.9.8

@@ -494,0 +499,0 @@ * Added. {{folder}} template option for parent folder. #96 by @shbatm.

"use strict";
var assert = require("assert");
exports["simple"] = function() {
describe('simple', function() {
var logger = require('../').console({

@@ -12,2 +12,3 @@ transport : function(data) {

var o = logger.info('hello');
it("simple logger", function () {
assert.equal(o['message'], 'hello');

@@ -17,5 +18,6 @@ assert.equal(o['file'], 'test.js');

assert.equal(o['level'], 3);
}
});
});
exports["stack index"] = function() {
describe('stack index', function() {
var logger = require('../').console({

@@ -32,8 +34,10 @@ stackIndex: 1,

var o = logMgr('info', 'hello');
it("stack index", function () {
assert.equal(o['message'], 'hello');
assert.equal(o['file'], 'test.js');
assert.equal(o['line'], 29);
}
assert.equal(o['line'], 31);
});
});
exports["simple message"] = function() {
describe('simple message' , function() {
var logger = require('../').console({

@@ -47,6 +51,8 @@ format : "{{message}}",

var o = logger.log('hello');
it("simple message", function () {
assert.equal(o['output'], 'hello');
}
});
});
exports["inspect depth"] = function() {
describe("inspect depth", function() {
var logger = require('../').console({

@@ -72,6 +78,8 @@ format : "{{message}}",

});
it("inspect depth", function () {
assert.equal(o['output'], "{ i1: 'value', i2: { i21: 'val21', i22: [Object] } }");
}
});
});
exports["simple color message"] = function() {
describe("simple color message", function() {
var logger = require('../').colorConsole({

@@ -85,6 +93,8 @@ format : "{{message}}",

var o = logger.debug('hello');
it("simple color message", function () {
assert.equal(o.output, '\u001b[36mhello\u001b[39m');
}
});
});
exports["console log method"] = function() {
describe('console log method' , function() {
var logger = require('../').console({

@@ -98,8 +108,10 @@ format : "{{message}}",

var o = logger.log('hello %s %d %j %t', 'world', 123, {j:'val'}, {t:'val'});
it("console log method", function () {
assert.equal(o['title'], 'log');
assert.equal(o['file'], '');//the format don't include "file", so can't get it
assert.equal(o['output'], 'hello world 123 {"j":"val"} { t: \'val\' }');
}
});
});
exports["custom format"] = function() {
describe("custom format", function() {
var logger = require('../').console({

@@ -118,2 +130,3 @@ format : [

});
it("custom format", function () {
var o = logger.log('hello %s %d', 'world', 123);

@@ -125,5 +138,6 @@ assert.equal(o['output'], 'hello world 123');

assert.equal(o['output'], 'error:hello world 123');
}
});
});
exports["custom filter"] = function() {
describe("custom filter", function() {
var colors = require('colors');

@@ -150,2 +164,3 @@ var logger = require('../').console({

var o = logger.log('hello %s %d', 'world', 123);
it("custom filter", function () {
assert.equal(o['output'], '\u001b[4mhello world 123\u001b[24m');

@@ -159,5 +174,6 @@ assert.equal(o['level'], 0);

assert.equal(o['level'], 5);
}
});
});
exports["set level to log"] = function() {
describe("set level to log", function() {
var logger = require('../').console({level:'log',

@@ -168,2 +184,3 @@ transport : function(data) {

});
it("set level to log", function () {
assert.ok(logger.log('hello'));

@@ -175,4 +192,5 @@ assert.ok(logger.trace('hello', 'world'));

assert.ok(logger.error('hello %s %d %j', 'world', 123, {foo:'bar'}, [1, 2, 3, 4], Object));
}
exports["set level to 0"] = function() {
});
});
describe("set level to 0", function() {
var logger = require('../').console({level:0,

@@ -183,2 +201,3 @@ transport : function(data) {

});
it("set level to 0", function () {
assert.ok(logger.log('hello'));

@@ -190,4 +209,5 @@ assert.ok(logger.trace('hello', 'world'));

assert.ok(logger.error('hello %s %d %j', 'world', 123, {foo:'bar'}, [1, 2, 3, 4], Object));
}
exports["set level to 2"] = function() {
});
});
describe("set level to 2", function() {
var logger = require('../').console({level:2,

@@ -198,2 +218,3 @@ transport : function(data) {

});
it("set level to 2", function () {
assert.ok(!logger.log('hello'));

@@ -205,4 +226,5 @@ assert.ok(!logger.trace('hello', 'world'));

assert.ok(logger.error('hello %s %d %j', 'world', 123, {foo:'bar'}, [1, 2, 3, 4], Object));
}
exports["set level to warn"] = function() {
});
});
describe("set level to warn", function() {
var logger = require('../').console({level:'warn',

@@ -213,2 +235,3 @@ transport : function(data) {

});
it("set level to warn", function () {
assert.ok(!logger.log('hello'));

@@ -220,4 +243,5 @@ assert.ok(!logger.trace('hello', 'world'));

assert.ok(logger.error('hello %s %d %j', 'world', 123, {foo:'bar'}, [1, 2, 3, 4], Object));
}
exports["set level to error"] = function() {
});
});
describe("set level to error", function() {
var logger = require('../').console({level:'error',

@@ -228,2 +252,3 @@ transport : function(data) {

});
it("set level to error", function () {
assert.ok(!logger.log('hello'));

@@ -235,4 +260,5 @@ assert.ok(!logger.trace('hello', 'world'));

assert.ok(logger.error('hello %s %d %j', 'world', 123, {foo:'bar'}, [1, 2, 3, 4], Object));
}
exports["set level to max value"] = function() {
});
});
describe("set level to max value", function() {
var logger = require('../').console({level:Number.MAX_VALUE,

@@ -243,2 +269,3 @@ transport : function(data) {

});
it("set level to max value", function () {
assert.ok(!logger.log('hello'));

@@ -250,5 +277,6 @@ assert.ok(!logger.trace('hello', 'world'));

assert.ok(!logger.error('hello %s %d %j', 'world', 123, {foo:'bar'}, [1, 2, 3, 4], Object));
}
});
});
exports["loop"] = function() {
describe("loop", function() {
var logger = require('../').console({

@@ -260,2 +288,3 @@ transport : function(data) {

});
it("loop", function () {
for(var i=0; i<100; i++){

@@ -265,8 +294,9 @@ var o = logger.info('hello');

assert.equal(o['file'], 'test.js');
assert.equal(o['line'], 238);
assert.equal(o['line'], 267);
assert.equal(o['level'], 3);
}
}
});
});
exports["setLevel 1"] = function() {
describe("setLevel 1", function() {
var logger = require('../').console({

@@ -278,2 +308,3 @@ transport : function(data) {

});
it("setLevel 1", function () {
require('../').setLevel(2);

@@ -286,6 +317,6 @@ assert.ok(!logger.log('hello'));

assert.ok(logger.error('hello %s %d %j', 'world', 123, {foo:'bar'}, [1, 2, 3, 4], Object));
});
});
}
exports["setLevel 2"] = function() {
describe("setLevel 2", function() {
var logger = require('../').console({

@@ -297,2 +328,3 @@ transport : function(data) {

});
it("setLevel 2", function () {
require('../').setLevel('debug');

@@ -305,6 +337,6 @@ assert.ok(!logger.log('hello'));

assert.ok(logger.error('hello %s %d %j', 'world', 123, {foo:'bar'}, [1, 2, 3, 4], Object));
});
});
}
exports["close"] = function() {
describe("close", function() {
var logger = require('../').console({

@@ -316,2 +348,3 @@ transport : function(data) {

});
it("close", function () {
require('../').close();

@@ -325,13 +358,15 @@ assert.ok(!logger.log('hello'));

assert.ok(!logger.fatal('hello %s %d %j', 'world', 123, {foo:'bar'}, [1, 2, 3, 4], Object, logger));
});
});
}
exports["simple"] = function() {
describe("simple", function() {
var logger = require('../').console();
var o = logger.log('hello');
it("recheck simple", function () {
assert.equal(o['message'], 'hello');
assert.equal(o['file'], 'test.js');
assert.equal(o['line'], 300);
assert.equal(o['line'], 333);
assert.equal(o['level'], 0);
}
});
});

@@ -103,3 +103,3 @@ // TypeScript Version: 2.6

dateformat?: string;
filters?: FilterFunction[] | LevelOption<FilterFunction> | Array<FilterFunction | LevelOption<FilterFunction | FilterFunction[]>>;
filters?: FilterFunction[] | LevelOption<FilterFunction | FilterFunction[]> | Array<FilterFunction | LevelOption<FilterFunction | FilterFunction[]>>;
/**

@@ -106,0 +106,0 @@ * Output the log, if level of log larger than or equal to `level`.

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