[Pkg-javascript-commits] [node-coveralls] 45/332: fixed logger bug in the last published version preventing --verbose from working. version bump to 2.0.11.
Bastien Roucariès
rouca at moszumanska.debian.org
Thu Nov 9 13:53:38 UTC 2017
This is an automated email from the git hooks/post-receive script.
rouca pushed a commit to branch master
in repository node-coveralls.
commit 5915e1c88adccdc0a2a8225c6ecc8a5ebf84bb0e
Author: cainus <gregg at caines.ca>
Date: Sun Jun 2 21:52:41 2013 -0700
fixed logger bug in the last published version preventing --verbose from working. version bump to 2.0.11.
---
Makefile | 2 +-
bin/coveralls.js | 7 ++-----
lib/convertLcovToCoveralls.js | 2 +-
lib/handleInput.js | 2 +-
lib/logger.js | 9 +++++++++
package.json | 5 +++--
test/convertLcovToCoveralls.js | 2 ++
7 files changed, 19 insertions(+), 10 deletions(-)
diff --git a/Makefile b/Makefile
index 15afcf9..9b4a1f4 100644
--- a/Makefile
+++ b/Makefile
@@ -14,7 +14,7 @@ test-cov: lib-cov
test-coveralls:lib-cov
$(MAKE) test REPORTER=spec
echo TRAVIS_JOB_ID $(TRAVIS_JOB_ID)
- @COVERALLS_COVERAGE=1 $(MAKE) test REPORTER=mocha-lcov-reporter | ./bin/coveralls.js
+ @COVERALLS_COVERAGE=1 $(MAKE) test REPORTER=mocha-lcov-reporter | ./bin/coveralls.js --verbose
rm -rf lib-cov
.PHONY: test
diff --git a/bin/coveralls.js b/bin/coveralls.js
index 578c692..ba05eec 100755
--- a/bin/coveralls.js
+++ b/bin/coveralls.js
@@ -1,14 +1,11 @@
#!/usr/bin/env node
var handleInput = require('../lib/handleInput');
-var logger = require('log-driver')({level : 'warn'});
+var logger = require('../lib/logger');
var options = {};
+
if (process.argv[2]) {
if (~['-v', '--verbose'].indexOf(process.argv[2])) {
- options.verbose = true;
- if (options.verbose){
- logger = require('log-driver')({level : 'debug'});
- }
if (process.argv[3]) {
options.filepath = process.argv[3];
}
diff --git a/lib/convertLcovToCoveralls.js b/lib/convertLcovToCoveralls.js
index ed5ec8b..a93c142 100644
--- a/lib/convertLcovToCoveralls.js
+++ b/lib/convertLcovToCoveralls.js
@@ -2,7 +2,7 @@ var TRAVIS_JOB_ID = process.env.TRAVIS_JOB_ID || 'unknown';
var fs = require('fs');
var lcovParse = require('lcov-parse');
var path = require('path');
-var logger = require('log-driver').logger;
+var logger = require('./logger');
var detailsToCoverage = function(length, details){
var coverage = new Array(length);
diff --git a/lib/handleInput.js b/lib/handleInput.js
index 703c87d..af850c6 100644
--- a/lib/handleInput.js
+++ b/lib/handleInput.js
@@ -3,7 +3,7 @@ var path = require('path');
var YAML = require('libyaml');
var sendToCoveralls = require('../index').sendToCoveralls;
var convertLcovToCoveralls = require('../index').convertLcovToCoveralls;
-var logger = require('log-driver').logger;
+var logger = require('./logger');
var handleInput = function(input, options){
logger.debug(input);
diff --git a/lib/logger.js b/lib/logger.js
new file mode 100644
index 0000000..f44fe28
--- /dev/null
+++ b/lib/logger.js
@@ -0,0 +1,9 @@
+var logger = require('log-driver')({level : 'warn'});
+
+if (process.argv[2]) {
+ if (~['-v', '--verbose'].indexOf(process.argv[2])) {
+ logger = require('log-driver')({level : 'debug'});
+ }
+}
+
+module.exports = logger;
diff --git a/package.json b/package.json
index 314d234..8986508 100644
--- a/package.json
+++ b/package.json
@@ -5,7 +5,7 @@
"coverage",
"coveralls"
],
- "version": "2.0.10",
+ "version": "2.0.11",
"bugs": {
"url": "https://github.com/cainus/node-coveralls/issues"
},
@@ -21,7 +21,8 @@
"contributors": [
"Alan Gutierrez <alan at prettyrobots.com> (http://www.prettyrobots.com/)",
"Kir Belevich (https://github.com/svg)",
- "elliotcable <github at elliottcable.name> (http://elliottcable.name/)"
+ "elliotcable <github at elliottcable.name> (http://elliottcable.name/)",
+ "Arpad Borsos <arpad.borsos at googlemail.com> (http://swatinem.de/)"
],
"dependencies": {
"libyaml": "0.2.2",
diff --git a/test/convertLcovToCoveralls.js b/test/convertLcovToCoveralls.js
index 6883f64..c83dc6c 100644
--- a/test/convertLcovToCoveralls.js
+++ b/test/convertLcovToCoveralls.js
@@ -1,6 +1,8 @@
var convertLcovToCoveralls = require('../index').convertLcovToCoveralls;
var should = require('should');
var fs = require('fs');
+var logger = require('../lib/logger');
+logger = require('log-driver')({level : false});
describe("convertLcovToCoveralls", function(){
it ("should convert a simple lcov file", function(){
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-coveralls.git
More information about the Pkg-javascript-commits
mailing list