Comparing version 0.0.3 to 0.1.0
# CHANGELOG | ||
## v0.1.0 | ||
* upgrade object logging to latest format from nodejs (Beresta) | ||
## v0.0.3 | ||
@@ -4,0 +8,0 @@ |
23
index.js
@@ -47,4 +47,6 @@ var dgram = require('dgram'); | ||
function format(f) { | ||
var util = require('util'); | ||
if (typeof f !== 'string') { | ||
var objects = [], util = require('util'); | ||
var objects = []; | ||
for (var i = 0; i < arguments.length; i++) { | ||
@@ -55,10 +57,11 @@ objects.push(util.inspect(arguments[i])); | ||
} | ||
var index = 1; | ||
var i = 1; | ||
var args = arguments; | ||
var str = String(f).replace(formatRegExp, function(x) { | ||
switch (x) { | ||
case '%s': return args[index++]; | ||
case '%d': return +args[index++]; | ||
case '%j': return JSON.stringify(args[index++]); | ||
case '%s': return String(args[i++]); | ||
case '%d': return Number(args[i++]); | ||
case '%j': return JSON.stringify(args[i++]); | ||
default: | ||
@@ -68,4 +71,8 @@ return x; | ||
}); | ||
for (var len = args.length; index < len; ++index) { | ||
str += ' ' + args[index]; | ||
for (var len = args.length, x = args[i]; i < len; x = args[++i]) { | ||
if (x === null || typeof x !== 'object') { | ||
str += ' ' + x; | ||
} else { | ||
str += ' ' + util.inspect(x); | ||
} | ||
} | ||
@@ -72,0 +79,0 @@ return str; |
{ | ||
"name" : "ain2", | ||
"description" : "Syslog logging for node.js. Continuation of ain", | ||
"version" : "0.0.3", | ||
"version" : "0.1.0", | ||
"main" : "./index", | ||
@@ -6,0 +6,0 @@ "author" : "Alexander Dorofeev <aka.spin@gmail.com>", |
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
14585
256