Comparing version 0.0.7 to 0.0.8
@@ -8,7 +8,6 @@ const LEVELS = require('./levels'); | ||
this.trace = (minLevelNum > LEVELS.trace) ? this.doNothing : this.trace; | ||
this.debug = (minLevelNum > LEVELS.debug) ? this.doNothing : this.debug; | ||
this.info = (minLevelNum > LEVELS.info) ? this.doNothing : this.info; | ||
this.warn = (minLevelNum > LEVELS.warn) ? this.doNothing : this.warn; | ||
this.error = (minLevelNum > LEVELS.error) ? this.doNothing : this.error; | ||
// fast track for frequent possibly disabled methods | ||
Object.defineProperty(this, 'trace', {value: (LEVELS.trace < minLevelNum) ? this.doNothing : this.trace }); | ||
Object.defineProperty(this, 'debug', {value: (LEVELS.debug < minLevelNum) ? this.doNothing : this.debug }); | ||
Object.defineProperty(this, 'info', {value: (LEVELS.info < minLevelNum) ? this.doNothing : this.info }); | ||
} | ||
@@ -15,0 +14,0 @@ |
@@ -67,2 +67,3 @@ const Log = require('./log'); | ||
write(log, level, message, ctx){ | ||
if(LEVELS[level] < this.minLevelNum) return; | ||
let time = Date.now(); | ||
@@ -69,0 +70,0 @@ let outputs = this.outputs; |
@@ -164,3 +164,3 @@ const LEVELS = { | ||
format(time, level, tag, msg, ctx) { | ||
let isoDate = new Date().toISOString(); | ||
let isoDate = new Date(time).toISOString(); | ||
let date = isoDate.substr(0, 10)+' '+isoDate.substr(11, 12); | ||
@@ -167,0 +167,0 @@ |
{ | ||
"name": "logel", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"description": "Externally controlled logging subsystem", | ||
@@ -5,0 +5,0 @@ "scripts": { |
21814