Comparing version 0.1.1 to 0.1.2
@@ -76,7 +76,7 @@ /* This Source Code Form is subject to the terms of the Mozilla Public | ||
+ text; | ||
} : function plain(text) { | ||
} : function plain(level, text) { | ||
text = coerce(text); | ||
return new Date().toUTCString() | ||
+ ' ' + name + ' ' + text; | ||
+ ' ' + name + '.' + level + ' ' + text; | ||
}; | ||
@@ -83,0 +83,0 @@ |
{ | ||
"name": "dbug", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "debug improvements", | ||
@@ -10,3 +10,4 @@ "main": "./lib/dbug.js", | ||
"devDependencies": { | ||
"mocha": "1.x" | ||
"mocha": "1.x", | ||
"utcstring": "0.1.x" | ||
}, | ||
@@ -13,0 +14,0 @@ "readmeFilename": "README.md", |
@@ -9,2 +9,4 @@ /* This Source Code Form is subject to the terms of the Mozilla Public | ||
const utc = require('utcstring'); | ||
const foo = require('../')('foo'); | ||
@@ -40,2 +42,6 @@ const bar = require('../')('bar'); | ||
function contains(haystack, needle) { | ||
return haystack.indexOf(needle) !== -1; | ||
} | ||
module.exports = { | ||
@@ -83,6 +89,2 @@ 'dbug': { | ||
function contains(haystack, needle) { | ||
return haystack.indexOf(needle) !== -1; | ||
} | ||
foo('z'); | ||
@@ -140,2 +142,18 @@ assert(contains(stdout.lastWrite, 'z')); | ||
assert(require('../')('foo').plain); | ||
}, | ||
'should format with utc': function() { | ||
process.env.DEBUG_COLOR = false; | ||
var plain = require('../')('foo'); | ||
process.stdout.write = testOut; | ||
plain('bar baz quux'); | ||
assert(utc.has(stdout.lastWrite)); | ||
assert(contains(stdout.lastWrite, 'bar baz quux')); | ||
plain('fuji', 'barbie'); | ||
assert(contains(stdout.lastWrite, 'fuji barbie')); | ||
process.stdout.write = out; | ||
} | ||
@@ -142,0 +160,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
26221
245
2
9