Comparing version 1.2.5 to 1.2.6
{ | ||
"name": "logplease", | ||
"version": "1.2.5", | ||
"version": "1.2.6", | ||
"description": "Simple Javascript logger for Node.js and Browsers", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -0,1 +1,3 @@ | ||
'use strict'; | ||
module.exports = { | ||
@@ -2,0 +4,0 @@ createWriteStream: function(filename, options) { |
'use strict'; | ||
const fs = require('fs'); | ||
const format = require('util').format; | ||
@@ -71,20 +72,20 @@ let isNodejs = process.version ? true : false; | ||
debug(text) { | ||
this._write(LogLevels.DEBUG, text); | ||
debug() { | ||
this._write(LogLevels.DEBUG, format.apply(null, arguments)); | ||
} | ||
log(text) { | ||
this.debug(text); | ||
log() { | ||
this.debug.apply(this, arguments); | ||
} | ||
info(text) { | ||
this._write(LogLevels.INFO, text); | ||
info() { | ||
this._write(LogLevels.INFO, format.apply(null, arguments)); | ||
} | ||
warn(text) { | ||
this._write(LogLevels.WARN, text); | ||
warn() { | ||
this._write(LogLevels.WARN, format.apply(null, arguments)); | ||
} | ||
error(text) { | ||
this._write(LogLevels.ERROR, text); | ||
error() { | ||
this._write(LogLevels.ERROR, format.apply(null, arguments)); | ||
} | ||
@@ -91,0 +92,0 @@ |
@@ -254,2 +254,14 @@ 'use strict'; | ||
}); | ||
it('formats strings using %d, %s', (done) => { | ||
let out = ''; | ||
let old = console.log; | ||
console.log = (d) => out += d; | ||
const log = Logger.create('test1234', { useColors: false }); | ||
log.debug('hi %d %s', 314, 'THISISASTRING'); | ||
console.log = old; | ||
let result = out.split(' ').slice(3).join(' '); | ||
assert.equal(result, 'hi 314 THISISASTRING'); | ||
done(); | ||
}); | ||
}); | ||
@@ -256,0 +268,0 @@ |
Sorry, the diff of this file is not supported yet
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
334494
16
1401