Comparing version 1.3.0 to 1.4.0
{ | ||
"name": "errorlog", | ||
"description": "Yet another logger for Node", | ||
"version": "1.3.0", | ||
"version": "1.4.0", | ||
"author": { | ||
@@ -23,4 +23,3 @@ "name": "Pier Fumagalli", | ||
"devDependencies": { | ||
"chai": "^2.2.0", | ||
"express": "^4.12.3", | ||
"chai": "^3.3.0", | ||
"grunt": "^0.4.5", | ||
@@ -27,0 +26,0 @@ "grunt-simple-mocha": "^0.4.0" |
@@ -52,2 +52,3 @@ Simple Error Log | ||
* `level`: the minimum level to log messages at | ||
* `errorlog.TRACE` or `0`: really low priority messages. | ||
* `errorlog.DEBUG` or `100`: debugging messages. | ||
@@ -57,4 +58,5 @@ * `errorlog.INFO` or `200`: informational messages _(default)_. | ||
* `errorlog.ERROR` or `400`: error messages. | ||
* `errorlog.FATAL` or `500`: fatel error messages. | ||
* `errorlog.ALL` or any number smaller than `100`: everything is logged. | ||
* `errorlog.OFF` or any number greater than `400`: disable logging. | ||
* `errorlog.OFF` or any number greater than `500`: disable logging. | ||
@@ -61,0 +63,0 @@ Options can be specified at construction wrapped in a simple object: |
@@ -10,2 +10,8 @@ 'use strict'; | ||
// Only one argument, the error... | ||
if ((arg.length == 1) && util.isError(arg[0])) { | ||
var error = arg[0]; | ||
return format(error.message || error.toString(), error); | ||
} | ||
// Process the format string and parameters | ||
@@ -42,3 +48,3 @@ if (util.isString(arg[0])) { | ||
// Dump stack traces for every exception | ||
if (arg[ptr] instanceof Error) { | ||
if (util.isError(arg[ptr])) { | ||
msg += '\n ' + arg[ptr].stack; | ||
@@ -45,0 +51,0 @@ } |
@@ -5,2 +5,4 @@ 'use strict'; | ||
var simplelog = require('../src/errorlog.js'); | ||
// No color test! | ||
simplelog.defaultColorize = false; | ||
@@ -50,2 +52,7 @@ // A regular expression matching an ISO date | ||
it('should log a simple exception', function() { | ||
log(new Error('simple error')); | ||
expect(stream.check()).to.match(/^ LOG - simple error\n Error: simple error\n at/m); | ||
}); | ||
it('should log a formatted message', function() { | ||
@@ -52,0 +59,0 @@ log('number %d string %s json %j percent % and %% borked %x nan %d end', 123.456, 'foobar', { hello: 'world' }, 'foo' ); |
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
23143
3
433
206