Comparing version 0.0.2 to 0.0.3
@@ -46,5 +46,5 @@ const LEVELS = require('./levels'); | ||
tmp(message, data){ | ||
temp(message, data){ | ||
this.trace(message, data); | ||
} | ||
} |
@@ -56,2 +56,3 @@ const LEVELS = { | ||
return this.serializeObject(v, depth); | ||
default: return this.styler.null('null'); | ||
} | ||
@@ -88,22 +89,25 @@ } | ||
let keys = Object.keys(obj); | ||
if(keys.length === 0){ | ||
return '{}'; | ||
} | ||
let lines = []; | ||
for(let k of keys){ | ||
let pathPart; | ||
if(reIdent.test(k)){ | ||
pathPart = this.styler.field((depth !== 0) ? ('.'+k) : k); | ||
}else{ | ||
pathPart = this.styler.string('['+escapeString(k)+']'); | ||
} | ||
let v = obj[k]; | ||
if(v !== undefined){ | ||
let pathPart; | ||
if(reIdent.test(k)){ | ||
pathPart = this.styler.field((depth !== 0) ? ('.'+k) : k); | ||
}else{ | ||
pathPart = this.styler.string('['+escapeString(k)+']'); | ||
} | ||
let serialized = this.serializeValue(obj[k], depth+1); | ||
if(serialized.multi != null){ | ||
lines = lines.concat(serialized.multi.map(l => pathPart+l)); | ||
let serialized = this.serializeValue(v, depth+1); | ||
if(serialized.multi != null){ | ||
lines = lines.concat(serialized.multi.map(l => pathPart+l)); | ||
} | ||
else{ | ||
lines.push(pathPart+': '+serialized); | ||
} | ||
} | ||
else{ | ||
lines.push(pathPart+': '+serialized); | ||
} | ||
} | ||
if(lines.length === 0){ | ||
return '{}'; | ||
} | ||
return { | ||
@@ -118,3 +122,3 @@ multi: lines, | ||
let cfg = PrettyFormatter.parseUrl(url); | ||
this.color = (cfg.color === 'auto') ? PrettyFormatter.detectAutoColor() : (cfg.color === 'always'); | ||
this.color = (cfg.color === 'auto') ? PrettyFormatter.getColorAuto() : (cfg.color === 'always'); | ||
this.maxArrayItemsToDisplay = 10; | ||
@@ -188,3 +192,3 @@ | ||
static detectAutoColor(){ | ||
static getColorAuto(){ | ||
return true; | ||
@@ -191,0 +195,0 @@ } |
{ | ||
"name": "logel", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Externally controlled logging subsystem", | ||
"main": "lib/index.js", | ||
"scripts": { | ||
@@ -19,4 +18,3 @@ "test": "jest" | ||
"chalk": "^2.4.2", | ||
"sonic-boom": "^0.7.3", | ||
"split2": "^3.1.0" | ||
"sonic-boom": "^0.7.3" | ||
}, | ||
@@ -23,0 +21,0 @@ "directories": { |
2
20861
468
- Removedsplit2@^3.1.0
- Removedinherits@2.0.4(transitive)
- Removedreadable-stream@3.6.2(transitive)
- Removedsafe-buffer@5.2.1(transitive)
- Removedsplit2@3.2.2(transitive)
- Removedstring_decoder@1.3.0(transitive)
- Removedutil-deprecate@1.0.2(transitive)